Every process designer needs a clever strategy to cancel a process at any point during its execution. A 25-step insurance claim process, for instance, must terminate as soon as the subscriber calls to rescind the claim. The hard way to solve this problem is to add cancellation checks at each of the 25 steps; more desirable is a single check or action that covers the execution of the entire process. There are two types of cancellation patterns: Cancel Activity and Cancel Case.
The intent of the Cancel Activity pattern is to stop the execution of a particular process activity on a cancellation trigger. This pattern is also known as Kill Activity.
The Cancel Activity pattern is useful to abort a long-running or suspended activity (e.g., a manual approval that has been ignored by its owner), or to reroute a process to an escalation path. The former case is shown in Figure 4-26.
Step X and
Step Y sits a long-running
Long step. To
enable the cancellation of
step during its execution, a deferred choice is
Cancellation event. As
soon as deferred choice completes,
Y is started, and the subsequent effects of the other
activity are ignored.
Figure 4-27 shows a BPMN implementation of this pattern.