Sub-Process

Subprocess
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, of Events, or for compensation.
— BPMN 2.0.2 Standard, 10.3., Sub-Processes

A Sub-Process is an activity that contains other activities, gateways, events, and so on, which in itself forms a process that is part of the bigger process. A Sub-Process is completely defined inside a parent process (that’s why it’s often called an embedded Sub-Process).

Sub-Processes have two major use cases:

  • Sub-Processes allow hierarchical modeling. Many modeling tools allow Sub-Processes to be collapsed, hiding all the details of the Sub-Process, resulting in a high-level, end-to-end overview of the business process.

  • A Sub-Process creates a new scope for events. Events that are thrown during execution of the Sub-Process can be caught by a boundary event on the boundary of the Sub-Process, creating a scope for that event limited to the Sub-Process.

Using a Sub-Process does impose some constraints:

A Sub-Process can only have one none start event; no other start event types are allowed. A Sub-Process must at least have one end event. Note that the BPMN 2.0 specification allows the omission of the start and end events in a Sub-Process, but the current Flowable implementation does not support this.

Sequence flows cannot cross Sub-Process boundaries.

Attributes (expanded Sub-process)

Group Attribute Description

Details

Is transaction

A BPMN transaction is a set of activities that logically belongs together. Transactions can be cancelled through the Cancel End Event and handled through the Cancel Intermediate Boundary Event.

Transaction method

The technique that will be used to undo a transaction that has been canceled.

Execution listeners

Active Execution Listeners of the process. This lets you react to the following events:

  • Start: Occurs when the process instance is started.

  • End: Occurs when the process instance is completed.

Asynchronous

When enabled, the activity will be started as an asynchronous job. The process state is persisted before this element is executed. Then, the process execution will be resumed asynchroneously. This can be used when the execution an activity takes a long time to return the UI to the user quicker in case the user does not need to see the next step immediately. However, if an error occurs before the following wait state, there will be no direct user feedback.

Data objects

Defines the Data Objects of the process or subprocess. Each data object will be initialized as a process variable under the defined name.

Attributes (collapsed Sub-process)

Group Attribute Description

Details

Execution listeners

Active Execution Listeners of the process. This lets you react to the following events:

  • Start: Occurs when the process instance is started.

  • End: Occurs when the process instance is completed.

Data objects

Defines the Data Objects of the process or subprocess. Each data object will be initialized as a process variable under the defined name.

Is call activity

A call activity is a wrapper for a globally defined Sub-Process that is reused in the current process.

Subprocess type

Subprocess type is an attribute that defines whether the sub-process details are embedded within the higher level process or refers to another, re-usable process. The default is embedded.

Is transaction

A BPMN transaction is a set of activities that logically belongs together. Transactions can be cancelled through the Cancel End Event and handled through the Cancel Intermediate Boundary Event.

Transaction method

The technique that will be used to undo a transaction that has been canceled.

Asynchronous

When enabled, the activity will be started as an asynchronous job. The process state is persisted before this element is executed. Then, the process execution will be resumed asynchroneously. This can be used when the execution an activity takes a long time to return the UI to the user quicker in case the user does not need to see the next step immediately. However, if an error occurs before the following wait state, there will be no direct user feedback.