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

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

Introduction

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

Prototype


public java.util.List<HistoryEvent> getEvents() 

Source Link

Document

A paginated list of history events of the workflow execution.

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  w w  .ja v a 2  s  .c  om
            }
        }
    }
}