Description
Abruptly terminates a workflow.
Attributes
Misc
Display Name - Renames the activity.
Exception - The Exception Type shown when the exception is thrown. Only accepts Exception variable types.
Reason - The string value shown when the exception is thrown.
Example
- Create a new workflow and save it as NewTerminateWorkflow.xml.
- Add a For Each<> activity inside the Sequence.
- Inside the Sequence, create a variable of the type System.Int32[] and give it the default value {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}.
- In the Values Property input field of the For Each activity, enter the variable name of the variable you created, e.g. variable1.
- Add a Sequence inside the For Each<> activity.
- Add an If activity inside the Sequence in the For Each<> activity.
- Enter item <= 5 in the Condition input field of the If activity.
- Add a Write Line activity inside the Then input field of the If activity and enter item.ToString in its Text Input Field.
- Add a Terminate Workflow activity inside the Else input field of the If activity.
- In the Terminate Workflow activity's Reason Misc Property, enter item > 5.
- When executed, the activities inside the Then field of the if activity will be executed while the Condition is met. When the Condition is not met, the Terminate Workflow activity will stop or terminate the execution of the workflow.
The use case should look like the following screenshot:
The output should look like this in the Output panel: