This activity can only be used in Microflows.
The Change workflow state activity can be used to add Abort, Continue, Pause, Restart, and Resume operations to a workflow and control workflow instances.
An example of change workflow state properties is represented in the image below:
There are two sets of properties for this activity, those in the dialog box on the left, and those in the properties pane on the right.
The Change workflow state properties pane consists of the following sections:
3 Action Section
The Action section of the properties pane shows the action associated with this activity.
You can open a dialog box to configure this action by clicking the ellipsis (…) next to the action.
You can also open the dialog box by double-clicking the activity in the microflow or right-clicking the activity and selecting Properties.
You can select the following operations that represent the new state of the workflow instance:
- Abort workflow – This operation aborts the workflow instance and brings it to its final state; there is no operation to undo an abort operation. The Reason property can be set for administration purposes to indicate why the workflow instance is aborted. For more information on the Reason property, see the Reason section below.
- Continue workflow – This operation continues the processing of the workflow instance from the point where it was before a new version of the workflow definition was deployed. The workflow instance will no longer be in the Incompatible state . If the task is no longer in the new workflow definition, this action results in an error.
- Pause workflow – This operation pauses further processing of the workflow. User tasks cannot be completed when the workflow instance is in the Pause state. Use the Resume workflow operation to resume processing of the workflow.
- Restart workflow – This operation stops the current task of the workflow and starts it from the initial task in the workflow definition. This action can be used when a workflow instance has become incompatible after a modified workflow definition has been deployed. Note that when the workflow instance is restarted, the workflow context object has the same values as before the Restart workflow operation was executed.
- Resume workflow – This operation resumes the workflow after it has been paused with the Pause workflow operation. User tasks can be completed again.
The workflow instance state changes are reflected in the System.Workflow.State attribute.
3.2 Workflow Object
The Workflow object property should be a specialization of the System.Workflow entity and identifies the workflow instance the operation should be executed on.
The Reason property is only used when Abort workflow is selected in the Operation property and allows you to add a description on why this workflow instance was aborted.
4 Common Section
For more information on properties in this section, see Common Properties.