This article shows how to use the different types of subprocesses in BPMN diagrams. Examples of normal subprocesses, looping, multiple instance, ad hoc, and compensation subprocesses.
We presented an introduction to BPMN diagrams two weeks ago. Business analysts are often required to document as-is processes and to-be processes. These diagrams help identify the scope of a software project. The diagrams can also help uncover requirements that might be overlooked without diagramming the processes.
The BPMN specification is designed to establish a common language and convention for creating process diagrams. This common convention allows people who are familiar with modeling, but new to a project to avoid learning a new diagramming language on each project or for each client. We have a link to the official version of the spec in our introductory post (we will update that link if and when the spec changes).
Subprocesses are one of two types of activities that can be included in a BPMN diagram. Each subprocess represents a set of activities – in fact, an entire process segment – within a business process. The other type of activity that we can represent is a task. This article focuses on subprocesses.
Why Use Subprocesses?
The most important element of business process modeling is communication. We communicate with stakeholders to get validation of the processes. We also communicate with the implementation team to assure that the software meets the customer’s requirements.
Stakeholders do not want to try and read incredibly complex multi-page diagrams. Developers need more details than a simple six-box diagram. Subprocesses allow us to achieve both types of communication.
We can create a simple diagram with subprocesses for the stakeholders, and then expand those subprocesses for the developers.
There are eleven different types of subprocesses that are defined within the BPMN specification. Six of those subprocess types are essentially the same as their task counterparts (see previous article onhow to diagram BPMN tasks).
These subprocesses are the same as the equivalent tasks.
- Multiple Instance
- Loop Compensation
- Multiple Instance Compensation
Subprocesses represent a collection of activities (and gateways and flows) being represented collectively as a single activity. There are times when the sequence of activites is undefined, or ad hoc. There is a subprocess type defined expressly for that purpose – the ad hoc subprocess. The ad hoc behavior can also be described for a compensation activity, for either type of looping activities (sequential and parallel), and for looping compensation activities.
The ad hoc subprocesses are enumerated as follows:
- Ad hoc – a collection of activities without a prescribed order or flow.
- Ad hoc Loop – an ad hoc subprocess that iterates sequentially.
- Ad hoc Multiple Instance – an ad hoc subprocess that iterates in parallel with itself.
- Ad hoc Compensation – an ad hoc subprocess that is triggered as a compensation for a specific activity.
- Ad hoc Loop Compensation – an ad hoc subprocess that iterates sequentially when triggered as a compensation.
- Ad hoc Multiple Instance Compensation – an ad hoc subprocess that iterates in parallel when triggered as a compensation.
BPMN Subprocess Legend
We will address the five distinct types of subprocesses highlighted in grey in the above. The remaining six subprocesses exhibit the combination of defined behaviors.
The following example is a business process model for eating an OREO.
On the left, we have a single swimming pool and swim lane, with a simple, three-step process. The second step, “Eat OREO” provides enough information at a high level for our stakeholders. Note the small plus sign at the bottom of the rectangle – this indicates that “Eat OREO” is a subprocess that can be expanded. The expansion is on the right. The subprocess provides our developers with enough information to know that OREOs must be eaten by first eating the filling and then eating the cookies.
A subprocess can also be a looping activity, which behaves the same way as a looping task. The only difference is that the entire subprocess is repeated instead of a single atomic task being repeated.
On the left, we now represent a business process for eating multiple OREOs. The “Eat OREOs” subprocess has the curved arrow symbol to indicate that it is a looping subprocess. The “Eat OREO” subprocess is repeated sequentially until complete. The center diagram shows the subprocess – note the curved arrow at the bottom of the bounding rectangle – indicating that this subprocess loops.
The “Eat Cookies” activity is also a subprocess, expanded in the rightmost diagram. Subprocesses can contain other subprocesses.
Multiple Instance Subprocess
Just as the multiple instance task allows for looping in parallel, the multiple instance subprocess allows for parallel execution of the subprocess. If we were to eat more than one OREO at a time, we could use the multiple instance subprocess instead of the loop subprocess.
We explained the behavior of a compensation task in our earlier post on using tasks. We’ve modified that example to demonstrate that the behavior for a compensation subprocesses is the same as for a task. The only difference is that the defined subprocess is executed, instead of the atomic task.
The compensation subprocess, “Credit Buyer” is triggered by the compensation event that is thrown when the buyer is unhappy with the purchase. The diagram on the top (including swim lanes for both the buyer and seller) clearly shows the process at a high level. The expanded subprocess below shows that there is a complex process for crediting the buyer. The subprocess shows that based on a complex criteria, the seller will either refund cash, reverse credit card charges, or give the buyer a store credit.
Ad hoc Subprocess
An ad hoc subprocess is one in which the specified steps are defined, but the order of operations is not.
From the business process modeling diagram on the left, we see that after inviting the guests, we execute a subprocess called “Clean House” and then the flow moves on to “Have Fun.” The subprocess box has a symbol that looks like a tilde (~), indicating that the subprocess is an ad hoc subprocess.
The three tasks within the subprocess are “Clean Kitchen”, “Mow Yard”, and “Clean Diningroom.” There is no specification of the sequence in which these activities are performed. This type of representation is common for documenting of manual processes that do not have defined sequences.
We also have the combination processes, such as an Ad hoc Loop Compensation subprocess. These combinations apply all of the behavior of all of the unique types they represent. For example, an Ad Hoc Loop subprocess would repeat multiple times, but the order of the steps within each iteration of the subprocess would be undefined.
Business process modeling subprocesses are very effective for communicating a summary or high level process definition to stakeholders, while also supporting the needed details for the implementation team.