public void execute()

in src/main/java/com/amazonaws/services/simpleworkflow/flow/worker/DecisionTaskPoller.java [215:250]


    public void execute(final DecisionTaskIterator tasks) throws Exception {
        RespondDecisionTaskCompletedRequest taskCompletedRequest = null;
        try {
            taskCompletedRequest = decisionTaskHandler.handleDecisionTask(tasks);
            if (decisionsLog.isTraceEnabled()) {
                decisionsLog.trace(WorkflowExecutionUtils.prettyPrintDecisions(taskCompletedRequest.getDecisions()));
            }
            service.respondDecisionTaskCompleted(taskCompletedRequest);
        } catch (Error e) {
            DecisionTask firstTask = tasks.getFirstDecisionTask();
            if (firstTask != null) {
                if (log.isWarnEnabled()) {
                    log.warn("DecisionTask failure: taskId= " + firstTask.getStartedEventId() + ", workflowExecution="
                            + firstTask.getWorkflowExecution(), e);
                }
            }
            throw e;
        } catch (Exception e) {
            DecisionTask firstTask = tasks.getFirstDecisionTask();
            if (firstTask != null) {
                if (log.isWarnEnabled()) {
                    log.warn("DecisionTask failure: taskId= " + firstTask.getStartedEventId() + ", workflowExecution="
                            + firstTask.getWorkflowExecution(), e);
                }
                if (log.isDebugEnabled() && firstTask.getEvents() != null) {
                    log.debug("Failed taskId=" + firstTask.getStartedEventId() + " history: "
                            + WorkflowExecutionUtils.prettyPrintHistory(firstTask.getEvents(), true));
                }
            }
            if (taskCompletedRequest != null && decisionsLog.isWarnEnabled()) {
                decisionsLog.warn("Failed taskId=" + firstTask.getStartedEventId() + " decisions="
                        + WorkflowExecutionUtils.prettyPrintDecisions(taskCompletedRequest.getDecisions()));
            }
            throw e;
        }
    }