Example usage for com.amazonaws.services.simpleworkflow.model DecisionTask getTaskToken

List of usage examples for com.amazonaws.services.simpleworkflow.model DecisionTask getTaskToken

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleworkflow.model DecisionTask getTaskToken.

Prototype


public String getTaskToken() 

Source Link

Document

The opaque string used as a handle on the task.

Usage

From source file:aws.example.helloswf.WorkflowWorker.java

License:Apache License

public static void main(String[] args) {
    PollForDecisionTaskRequest task_request = new PollForDecisionTaskRequest().withDomain(HelloTypes.DOMAIN)
            .withTaskList(new TaskList().withName(HelloTypes.TASKLIST));

    while (true) {
        System.out.println("Polling for a decision task from the tasklist '" + HelloTypes.TASKLIST
                + "' in the domain '" + HelloTypes.DOMAIN + "'.");

        DecisionTask task = swf.pollForDecisionTask(task_request);

        String taskToken = task.getTaskToken();
        if (taskToken != null) {
            try {
                executeDecisionTask(taskToken, task.getEvents());
            } catch (Throwable th) {
                th.printStackTrace();/*from  w  ww  . java  2 s  .  co  m*/
            }
        }
    }
}