A process diagram may contain not only tasks but also sub-processes. A sub-process may also be presented as a reference to an activity. When you simulate performance of such process, you simulate performance of the sub-process as well. There are some rules that should be followed in order to avoid simulation errors.
When you run simulation of a process diagram that has a sub-process, the simulation engine jumps to the sub-process diagram, simulates its performance and goes back to the process diagram. In order the simulation engine does it correctly, the following rules should be followed:
The simulation engine may exit the sub-process diagram in case some condition is met, even though sub-process instance is not completed yet. Boundary events are used to model such situations.
Example 1
Look at Figure 1 for an example. The "New comments added" and "Contract refused" events are connected to the "Agree contract" sub-process and are of the Intermediate boundary event (Interrupting) type. The sub-process diagram contains the same events as end events (Figure 2).
Example 2
The "Organize shipping of goods" process diagram (Figure 3) contains the "25 days passed" event shape that is connected to the "Wait for payment" sub-process shape. The event shape is of the Intermediate boundary event (Non-interrupting) type; thus, occurrence of the simulation event instance activates the "Notify Manager" simulation task instance. At the same time performance of the "Wait for payment" simulation sub-process instance will not be interrupted and the "Submit documents to the Debt department" simulation task instance will be performed.
The process and the sub-process diagrams can be designed in different notations. The simulation engine performs the process and as soon as it meets the sub-process, it jumps to its diagram and starts its performance immediately. The number of instances that are created, equals the number of starting points on the sub-process diagram. For Flowcharts and EPC diagrams, the starting point is an event shape that has no incoming flows. For BPMN diagrams, the starting point is the event shape of the None trigger type or the task/gateway shapes that have no incoming sequence flows. The simulation engine goes back to the process diagram as soon as all the instances of the sub-process are completed.
Look at Figure 5 for an example. The process diagram is in the Flowchart notation (Figure 5), and the sub-process diagram is an EPC (Figure 6). As soon as the simulation engine enters "Step 2", it jumps to the sub-process diagram which is in EPC, and activates the "Event 2" and "Event 3" events immediately.
To learn about reusable activities go to the Reference to Activity article.
Example:
See Figure 7 for the "Draw up list of comments on project" process diagram. It contains the "Organize project results meeting" sub-process shape that is a reference to the reusable activity, whose diagram is presented in Figure 8.
The process and the reusable activity diagrams can be designed in the Flowchart/EPC notations or in BPMN. The simulation engine performs the process and as soon as it meets the sub-process, it jumps to the reusable activity diagram and starts its performance immediately. The number of instances that are created, equals the number of starting points in the reusable activity diagram. For Flowcharts and EPC diagrams, the starting point is an event shape that has no incoming flows. For BPMN diagrams, the starting point is the event shape of the None trigger type or the task/gateway shapes that have no incoming sequence flows. The simulation engine goes back to the process diagram as soon as all the instances of the reusable activity are completed.
Example
See Figure 9 for the process in the Cross-functional Flowchart notation. Its diagram contains a reference to the reusable activity (Step 1) whose diagram you see in Figure 10.
In case the process and the reusable activity diagrams are both designed in the EPC notation, the simulation engine’s behavior differs.
The simulation engine enters the reusable activity diagram, but starts creating its instances only in case it finds the shape of the event that activates performance of the reference to the reusable activity in the process diagram. This event should be the start event in the reusable activity diagram and only this event is activated. The reusable activity instance ends as soon as the end event is activated in its diagram. To make the simulation engine return to the process diagram you should add the event, whose shape is used as the end event in the reusable activity diagram, to the process diagram. And it should follow the shape of the Reference to the reusable activity. The simulation engine finds this event among those that follow the Reference to the reusable activity, and activates it.
See Figures 11 and 12 for an example. The process diagram contains the "Step 1" process. This process is a reference to the activity whose diagram you see in Figure 12. Note that the "Step 1" process has the "Event 1" event as an activating event and the "Event 2" event as an event that is created as a process result. These same events you see as start and end events in the reusable activity diagram (Figure 12).