Using boundary events to implement the cancel message use case
Putting a boundary event on every task can obviously clutter up your process model very quickly, and often we want to treat a group of activities as atomic—we want them all to happen, or none of them. This leads us naturally to the next level of sophistication in the use of boundary events—grouping activities in a sub-process and attaching boundary events to the sub-process.
Let's take a look at this approach now by building an example around the concept of processing an order, but where the possibility of the order being cancelled exists:
Create a new Process in your BoundaryEvents application and name it CancelBoundaryEvent.
Note
Let's begin by laying out the process, so we can visualize what we are doing. Then, we will go back and define the data we need. In this example, we are going to use correlation so that we can make sure the cancel message goes to the right process instance.
Move the End node to the side to create some...