Let’s consider a process diagram borrowed (with some simplifications) from the book by Stephen White, Derek Miers, “BPMN Modeling And Reference Guide”, p. 113:
![Example of Milestone process pattern implemented with BPMN signal event)](http://mainthing.ru/wp-content/uploads/2010/11/signal-e.png)
The diagram illustrates a fragment of book creation process. The process splits into two subprocesses executed in parallel: writing text and developing book cover. The point is that book cover development may start only when the concept is ready.
The challenge of implementing this logic is that we can’t use sequence flow because it cannot cross subprocess boundary. (Let’s leave apart the question why we need subporcesses here; let’s just suppose we need them for some reason.) We can’t use message flow either because it’s all within a single pool.
The standard recommendation is to use BPMN signal event:
- when the concept is ready, first subporcess triggers a signal
- second process was awaiting for the signal; after catching the signal it proceeds to “Develop Book Cover” task
It’s so called “Milestone” process pattern. A similar example of BPMN signal usage is given in the book by Bruce Silver, “BPMN Method and Style”, p. 98.
Where is the catch?
Everything is OK as long as we consider a signle book creation. Now let’s suppose several books are processed at once. Recalling that BPMN signal is broadcasted to everyone awaiting it at the given moment, as soon as the concept of first book is ready all designers will receive the signal to start developing the cover. Not exactly what we expected.
In order to make the diagram work we must limit the signal propagation somehow. How it can be done?
- The first thing that comes into my mind is an attribute that would limit signal broadcasting by the current process instance boundaries. Yet there is no such attribute in the standard. Under BPMN 1.x one may say that it’s implementation issue not covered by the standard. But BPMN 2.0 fully specify the process metamodel. Let’s look at page 281 of OMG document dated June 2010: signal has a single attribute - its name. Therefore, a signal will be transmitted to all process instances.
- If the signal has only name then let’s use what we have. The diagram above may work if we could change signal name dynamically i.e. during the process execution. If we could name the signal “Process 999 Concept Ready” instead of “Concept Ready” then everything will be fine. But it’s a dirty hack and it’s hard to count on it. BPMS engines allow to change certain things during the execution (e.g. timer settings) but unlikely the name.
Why we should care.
Depending on whether we may use signal events to coordinate flows within a process instance, we should chose one process architecture or another:
- if signals propagation can be limited, one can freely use subprocesses - whenever the need to synchronize them arises, it can be done by a signal
- if signals transmit without limits then the only option is to launch separate processes for each branch because we can synchronize processes by message flows, resulting in a diagram like this:
![Example of Milestone process pattern implemented with BPMN message flow](http://mainthing.ru/wp-content/uploads/2010/11/message-e.png)
Conclusions:
- The BPMN standard lacks an attribute giving an option to limit signal event propagation.
- As long as there is no way to limit the signal propagation, the “Milestone” process pattern should be implmented by message flows between separate pools.