Using the Cancellation Event Handler
You can execute a cancellation event handler flow (only one per process) to manage the cancellation of a process and its sub-processes.
Procedure
-
How to cancel a sub-process task: Attach a catch intermediate event to a call sub-process task in your main process, with a trigger type of Catch Signal. The Catch Action should be
Cancel task when signal caught.
Alternatively, you cancel a process sub-process task with a task boundary event also with the following event types:
The tree of subprocess instances that were instantiated from a sub-process task are cancelled from the bottom up. If the sub-processes need to execute compensation actions to close down gracefully, they can do so using Cancellation Event handlers.
-
The Sub-Process Cancellation event handler: Add activities to perform any actions required prior to the final sub-process cancellation. A common pattern would be to use throw-catch compensation as in the example below, where there is an intermediate catch event with trigger type Catch Compensation on each task in the a sub-process which requires compensation events. Compensation events execute their actions if only when the task they're attached to has been executed, thus there is not a need to manually conditionalize compensating tasks, depending on the progress through the main process flow.
Note:
- The sub-process can also invoke another sub-process (and so on) with more cancel event handlers.
- There does not have to be a cancel event handler in each sub-process if it is not required.
- Cancellation event handlers will not be executed when a process instance is cancelled through the Process Management Service API.
- If a cancellation event handler fails, then you will receive an audit event and should be able to recover from an halted state.
Copyright © 2021. Cloud Software Group, Inc. All Rights Reserved.