SWF starts communicating with actors from the start to the completion of a workflow and allocates respective activities and decision tasks to these actors. Figure 14.3 describes the life cycle of a customer order-processing workflow:
Figure 14.3: Workflow execution lifecycle
Here are the steps shown in Figure 14.3:
- The workflow starter starts the workflow execution by calling the
StartWorkflowExecution
action with order information. - SWF gets the request to start the workflow execution, sends it back with a
WorkflowExectuionStarted
event, and schedules a decision task raising aDecisionTaskScheduled
event. - A process configured as a decider in the workflow, polls for a decision task using the
PollForDecisionTask
action, and receives the decision task from SWF along with the task history. The decider then uses coordination logic to ensure that the execution is not already run. After verification, it schedules the verify order activity using theScheduleActivityTask...