Work Item Life Cycle
Internally, every component can be in one of four states: nonstarted, processing, complete, and cancelled. Only the complete state is visible outside a component.
- The nonstarted state indicates that the component has not yet received a token and thus has not yet started task execution.
- The processing state means that the component task is in progress.
- The complete state indicates that the component has completed its task and sent the output token to its successors.
- The cancelled state is an abnormal state that a component enters if it is unable to complete its task or has been ordered by its container to abort the task. The latter occurs when some other component inside a workflow has been cancelled or the workflow engine received a message to do so.
A component completes its task when it terminates the task in a normal condition; the meaning of normal depends on the component. A terminated task could have succeeded in performing its job or not, but in any case the component can be cancelled. A workflow cannot be cancelled after it has completed the task, because it ceases to exist when it communicates its completion to the workflow engine. Figure 31 summarizes the mechanism represented as a state machine in Unified Modeling Language (UML) notation.
![]()
When a component cancels, it has to undo anything that may affect the external world, such as directory operations or e-mails. Cancellation ensures that the whole workflow will be cancelled and that all work items are cancelled in the reverse order of their execution.