Example usage for com.amazonaws.services.simpleworkflow.model PollForDecisionTaskRequest PollForDecisionTaskRequest

List of usage examples for com.amazonaws.services.simpleworkflow.model PollForDecisionTaskRequest PollForDecisionTaskRequest

Introduction

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

Prototype

PollForDecisionTaskRequest

Source Link

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 .j ava 2s.c o m
            }
        }
    }
}