<resourceParameterBinding parameterRef="tns:buyerName"> <formalExpression>getDataInput('order')/address/name</formalExpression>

</resourceParameterBinding> </potentialOwner>

</userTask>

<sequenceFlow sourceRef="ReviewOrder" targetRef="EndProcess"/>

<endEvent id="EndProcess"/>

</process> </definitions>

10.3.5 Sub-Processes

A Sub-Process is an Activity whose internal details have been modeled using Activities, Gateways, Events, and Sequence Flows. A Sub-Process is a graphical object within a Process, but it also can be “opened up” to show a lower-level Process. Sub-Processes define a contextual scope that can be used for attribute visibility, transactional scope, for the handling of exceptions (see page 274 for more details), of Events, or for compensation (see page 301 for more details).

There are different types of Sub-Processes, which will be described in the next five sub clauses.

Embedded Sub-Process (Sub-Process)

A Sub-Process object shares the same shape as the Task object, which is a rounded rectangle. A Sub-Process is a rounded corner rectangle that MUST be drawn with a single thin line.

The use of text, color, size, and lines for a Sub-Process MUST follow the rules defined in “Use of Text, Color, Size, and Lines in a Diagram” on page 39 with the exception that:

A boundary drawn with a thick line SHALL be reserved for Call Activity (Sub-Processes) (see page 182).

A boundary drawn with a dotted line SHALL be reserved for Event Sub-Processes (see page 174).

A boundary drawn with a double line SHALL be reserved for Transaction Sub-Processes (see page 176).

The Sub-Process can be in a collapsed view that hides its details (see Figure 10.25 ) or a Sub-Process can be in an expanded view that shows its details within the view of the Process in which it is contained (see Figure 10.26 ). In the collapsed form, the Sub-Process object uses a marker to distinguish it as a Sub-Process, rather than a Task.

The Sub-Process marker MUST be a small square with a plus sign (+) inside. The square MUST be positioned at the bottom center of the shape.

Collapsed

Sub-

Process

Figure 10.25 – A Sub-Process object (collapsed)

Business Process Model and Notation (BPMN), v2.0.2

171

S u b -P ro c e s s (E x p a n d e d )

Figure 10.26 – A Sub-Process object (expanded)

They are used to create a context for exception handling that applies to a group of Activities (see page 274 for more details). Compensations can be handled similarly (see page 301 for more details).

Expanded Sub-Processes can be used as a mechanism for showing a group of parallel Activities in a less-cluttered, more compact way. In Figure 10.27, Activities “C” and “D” are enclosed in an unlabeled expanded Sub-Process. These two Activities will be performed in parallel. Notice that the expanded Sub-Process does not include a Start Event or an End Event and the Sequence Flows to/from these Events. This usage of expanded Sub-Processes for “parallel boxes” is the motivation for having Start and End Events being optional objects.

C

A E

D

Figure 10.27 – Expanded Sub-Process used as a “Parallel Box”

BPMN specifies five types of standard markers for Sub-Processes. The (Collapsed) Sub-Process marker, seen in Figure 10.24, can be combined with four other markers: a loop marker or a multi-instance marker, a Compensation marker, and an Ad-Hoc marker. A collapsed Sub-Process MAY have one to three of these other markers, in all combinations except that loop and multi-instance cannot be shown at the same time (see Figure 10.28).

The marker for a Sub-Process that loops MUST be a small line with an arrowhead that curls back upon itself. The loop marker MAY be used in combination with any of the other markers except the multi-instance marker.

The marker for a Sub-Process that has multiple instances MUST be a set of three vertical lines in parallel.

The multi-instance marker MAY be used in combination with any of the other markers except the loop marker. The marker for an ad-hoc Sub-Process MUST be a “tilde” symbol.

The ad-hoc marker MAY be used in combination with any of the other markers.

The marker for a Sub-Process that is used for compensation MUST be a pair of left facing triangles (like a tape player “rewind” button).

The Compensation marker MAY be used in combination with any of the other markers.

172

Business Process Model and Notation (BPMN), v2.0.2

All the markers that are present MUST be grouped and the whole group centered at the bottom of the

Sub-Process.

L o o p

M u lti-In s ta n c e C o m p e n s a tio n

A d -H o c

C o m p e n s a tio n

a n d A d -H o c

 

 

 

~ ~

Figure 10.28 – Collapsed Sub-Process Markers

The Sub-Process now corresponds to the Embedded Sub-Process of BPMN 1.2. The Reusable Sub-Process of BPMN 1.2 corresponds to the Call Activity (calling a Process - see page 182). Figure 10.29 shows the class diagram related to SubProcesses.

Figure 10.29– The Sub-Process class diagram

The Sub-Process element inherits the attributes and model associations of Activity (see Table 10.3) and of FlowElementContainer (see Table 8.45). Table 10.3 presents the additional attributes of the Sub-Process element.

Business Process Model and Notation (BPMN), v2.0.2

173

Table 10.20 – Sub-Process attributes

Attribute Name

Description/Usage

 

 

triggeredByEvent: boolean = false

A flag that identifies whether this Sub-Process is an

 

Event Sub-Process.

 

• If false, then this Sub-Process is a normal Sub-Process.

 

• If true, then this Sub-Process is an Event Sub-Process and is subject

 

to additional constraints (see page 174).

 

 

artifacts: Artifact [0..*]

This attribute provides the list of Artifacts that are contained within the Sub-

 

Process.

 

 

Reusable Sub-Process (Call Activity)

The reusable Sub-Process of BPMN 1.2 corresponds to the Call Activity that calls a predefined Process. See details of a Call Activity on page 182.

Event Sub-Process

An Event Sub-Process is a specialized Sub-Process that is used within a Process (or Sub-Process). A SubProcess is defined as an Event Sub-Process when its triggeredByEvent attribute is set to true.

An Event Sub-Process is not part of the normal flow of its parent Processthere are no incoming or outgoing

Sequence Flows.

An Event Sub-Process MUST NOT have any incoming or outgoing Sequence Flows.

An Event Sub-Process MAY or MAY NOT occur while the parent Process is active, but it is possible that it will occur many times. Unlike a standard Sub-Process, which uses the flow of the parent Process as a trigger, an Event Sub-Process has a Start Event with a trigger. Each time the Start Event is triggered while the parent Process is active, then the Event Sub-Process will start.

The Start Event of an Event Sub-Process MUST have a defined trigger.

The Start Event trigger (EventDefinition) MUST be from the following types: Message, Error,

Escalation, Compensation, Conditional, Signal, and Multiple (see page 259 for more details). An Event Sub-Process MUST have one and only one Start Event.

An Event Sub-Process object shares the same basic shape as the Sub-Process object, which is a rounded rectangle.

An Event Sub-Process is a rounded corner rectangle that MUST be drawn with a single thin dotted line (see Figure 10.30 and Figure 10.31).

The use of text, color, size, and lines for an Event Sub-Process MUST follow the rules defined in “Use of Text, Color, Size, and Lines in a Diagram” on page 39 with the exception that:

If the Event Sub-Process is collapsed, then its Start Event will be used as a marker in the upper left corner of the shape (see Figure 10.30).

174

Business Process Model and Notation (BPMN), v2.0.2

E v e n t S u b -

P r o c e s s

Figure 10.30 – An Event Sub-Process object (Collapsed)

E x p a n d e d E ve n t S u b -P ro c e ss

Figure 10.31 – An Event Sub-Process object (expanded)

There are two possible consequences to the parent Process when an Event Sub-Process is triggered: 1) the parent Process can be interrupted, and 2) the parent Process can continue its work (not interrupted). This is determined by the type of Start Event that is used. See page 241 for the list of interrupting and non-interrupting Event Sub-Process Start Events.

Figure 10.32 provides an example of a Sub-Process that includes three Event Sub-Processes. The first Event SubProcess is triggered by a Message, does not interrupt the Sub-Process, and can occur multiple times. The second Event Sub-Process is used for compensation and will only occur after the Sub-Process has completed. The third Event Sub-Process handles errors that occur while the Sub-Process is active and will stop (interrupt) the SubProcess if triggered.

Business Process Model and Notation (BPMN), v2.0.2

175