decider.decide();
return decider.getAsynchronousThreadDumpAsString();
}
private AsyncDecider createDecider(HistoryHelper historyHelper) throws Exception {
DecisionTask decisionTask = historyHelper.getDecisionTask();
WorkflowType workflowType = decisionTask.getWorkflowType();
if (log.isDebugEnabled()) {
log.debug("WorkflowTask received: taskId=" + decisionTask.getStartedEventId() + ", taskToken="
+ decisionTask.getTaskToken() + ", workflowExecution=" + decisionTask.getWorkflowExecution());
}
WorkflowDefinitionFactory workflowDefinitionFactory = definitionFactoryFactory.getWorkflowDefinitionFactory(workflowType);
if (workflowDefinitionFactory == null) {
log.error("Received decision task for workflow type not configured with a worker: workflowType="
+ decisionTask.getWorkflowType() + ", taskToken=" + decisionTask.getTaskToken() + ", workflowExecution="
+ decisionTask.getWorkflowExecution());
if (workflowDefinitionFactory == null) {
throw new IllegalArgumentException("No implementation was found for " + decisionTask.getWorkflowType());
}
}
DecisionsHelper decisionsHelper = new DecisionsHelper(decisionTask);
AsyncDecider decider = new AsyncDecider(workflowDefinitionFactory, historyHelper, decisionsHelper);
return decider;