Lock Workflow
This activity can only be used in Microflows.
This activity was introduced in Studio Pro 9.23.0.
Introduction
The Lock workflow activity can be used to lock a workflow.
This microflow activity allows developers to build a function for the workflow administration that stops the workflow execution. The Lock workflow activity can be used when the workflow definition contains errors and you have to prevent further damage to the process execution or data that will be difficult to undo/revert.
The information whether the workflow is locked is stored in the IsLocked attribute of the WorkflowDefinition entity. For more information, see the Workflow Entities in the System Module section in Workflows.
For information on unlocking the workflow, see the Unlock Workflow.
Properties
An example of Lock workflow 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 Lock workflow properties pane consists of the following sections:
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.
Workflow
The workflow that is locked by this activity.
Pause Instances
With this option, all existing instances of the selected workflow which are in Incompatible or In-Progress state are paused. We do not pause the Aborted and Completed workflow instances because those are final states and there is no way to revert those instances. It is not possible to pause Failed workflow instances, because even if you unpause them by unlocking the workflow, they would not start to run automatically and you would lose data on the reason of a failure.
This option is enabled by default.
Workflow State Transitions Upon Lock And Unlock
In the table below you can see all workflow state transitions upon lock and unlock the workflow.
State | State After Pausing Instances Upon Lock | State After Reverting Instances Upon Unlock |
---|---|---|
InProgress | Paused | InProgress |
Incompatible | Paused | Incompatible |
Paused | Paused | Paused |
Failed | Failed | Failed |
Aborted | Aborted | Aborted |
Completed | Completed | Completed |