Runtime states for activities in workflows
At run time, different events cause activities to transition between various states. And the state that an activity is in determines which actions can be performed.
When an activity's parent workflow is started, if the activity has a precondition, the precondition is evaluated. Depending on the type of the activity and any preconditions, the activity is put into one of three initial states:
- If an automatic activity has no precondition or if it has a precondition that is evaluated to true, the activity is put into the WORKING state.
- If a manual activity has no precondition or if it has a precondition that is evaluated to true, the activity is put into the READY state.
- For both automatic and manual activities, if the activity has a precondition that evaluated to false, the activity is put into the WAITING state.
For each non-end state, a set of events or actions cause the activity to go into another state.
WAITING state
An activity is in the WAITING state because the precondition evaluated to false. Manual activities with the WAITING state are in the Ready category while automatic activities with the WAITING state are in the In progress category. When one of the following events occurs, the state of the activity changes:
- When the precondition evaluates to true:
- If it is an automatic activity, the activity changes to the LAUNCHING state.
- If it is a manual activity, the activity changes to the READY state.
- If the user clicks Disable or the corresponding REST API is invoked, the activity changes to the DISABLED state.
- If the activity is optional and the enclosing scope ends, the activity changes to the NOT USED state.
LAUNCHING state
The LAUNCHING state is transitory for automatic activities. It indicates that the activity is starting. When the activity is successfully started, it automatically changes to the WORKING state.
READY state
When a manual activity is in the READY state, it waits until one of the following events occurs:
- If the user clicks Start or the corresponding REST API is invoked, the activity changes to the WORKING state.
- If the user clicks Disable or the corresponding REST API is invoked, the activity changes to the DISABLED state.
- If the activity is optional and the enclosing scope ends, the activity changes to the NOT USED state.
WORKING state
An activity stays in the WORKING state until one of the following events occurs:
- If the activity completes successfully, it changes to the COMPLETED state.
- If the activity completes unsuccessfully, it changes to the FAILED state.
COMPLETED state
The COMPLETED state is an end state for activities that completed successfully.
FAILED state
If an error occurs during the completion of an activity, it is put into the FAILED state. An activity stays in the FAILED state until the administrator completes one of the following actions:
- The administrator repairs the activity and restarts it. The activity is put into the WORKING state.
- The administrator determines that the activity cannot be repaired and puts it into the SKIPPED state. The processing of the instance continues without the activity.
NOT USED state
The NOT USED state is an end state for optional activities that are no longer available because the enclosing scope for the activity is closed.
DISABLED state
- If the user clicks Enable or the corresponding REST API is invoked, the activity returns to the state that the activity was in when it was disabled: WAITING or READY.
- If the activity is optional and the enclosing scope ends, the activity changes to the NOT USED state.
SKIPPED state
The SKIPPED state is an end state for activities. This state occurs when an administrator repairs a failed workflow instance by cancelling the activity in the instance.
You can apply filters to the list of activities. The filters have the following effect:
- Ready shows manual activities that are in the READY or WAITING state.
- In progress shows all activities that are in the WORKING state or automatic activities that are in the WAITING state.
- Complete shows activities that are in COMPLETED, FAILED, and DISABLED states.
- In Workflow Inspector, All shows all activities regardless of their state.
Parent topic: