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.5, 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 is why it is 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

General

ID

The unique identifier of the element within the process model.

Name

The name of the element. This is the name displayed in the diagram.

Documentation

A description and additional information about this element.

Details

Data objects

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

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 is used to undo a transaction that has been canceled.

Execution listeners

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

  • Start: Occurs when the activity is started.

  • End: Occurs when the activity is completed.

Asynchronous

When enabled, the activity is started as an asynchronous job. The process state is persisted before this element is executed. Then the process execution is resumed asynchroneously. This can be used when the execution of an activity takes a long time to return the user interface. However, if an error occurs before the following wait state, there is no direct user feedback.

Is for compensation

Determines whether the activity can serve as a compensation for another activity.

Multi instance

Multi instance type

Determines if multiple instances of this activity are created. There are three choices:

  • None (default, only one instance is created).

  • MI parallel (activities are created in parallel. This is a good practice for User Tasks).

  • MI sequential (activities are created sequentially. This is a good practice for Service Tasks).

Once a type other than None is chosen, the following options appear:

  • Collection: The number of instances is determined by the elements of a collection. For each element in the collection, a new instance is created.

  • Element variable: The variable under which each element is available to the newly created instance.

  • Element index variable: The variable under which the current number of iterations is stored.

  • Completion condition: An expression which, if it evaluated to true, stops the creation of new instances.

  • Cardinality: An expression or numeric value (integer) which determines how many instances are created.

Visual

Font weight

The font weight of the element in the diagram.

Font size

The font size of the element in the diagram.

Font color

The font color of the element in the diagram.

Font style

The font style of the element in the diagram.

Background color

The background color of the element in the diagram.

Border color

The border color of the element in the diagram.

Attributes (collapsed Sub-process)

Group Attribute Description

General

ID

The unique identifier of the element within the process model.

Name

The name of the element. This is the name displayed in the diagram.

Documentation

A description and additional information about this element.

Details

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.

Data objects

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

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 is used to undo a transaction that has been canceled.

Subprocess ref.

Reference of an existing process that is started globally when executing the activity.

Execution listeners

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

  • Start: Occurs when the activity is started.

  • End: Occurs when the activity is completed.

Asynchronous

When enabled, the activity is started as an asynchronous job. The process state is persisted before this element is executed. Then the process execution is resumed asynchroneously. This can be used when the execution of an activity takes a long time to return the user interface. However, if an error occurs before the following wait state, there is no direct user feedback.

Is for compensation

Determines whether the activity can serve as a compensation for another activity.

Multi instance

Multi instance type

Determines if multiple instances of this activity are created. There are three choices:

  • None (default, only one instance is created).

  • MI parallel (activities are created in parallel. This is a good practice for User Tasks).

  • MI sequential (activities are created sequentially. This is a good practice for Service Tasks).

Once a type other than None is chosen, the following options appear:

  • Collection: The number of instances is determined by the elements of a collection. For each element in the collection, a new instance is created.

  • Element variable: The variable under which each element is available to the newly created instance.

  • Element index variable: The variable under which the current number of iterations is stored.

  • Completion condition: An expression which, if it evaluated to true, stops the creation of new instances.

  • Cardinality: An expression or numeric value (integer) which determines how many instances are created.

Visual

Font weight

The font weight of the element in the diagram.

Font size

The font size of the element in the diagram.

Font color

The font color of the element in the diagram.

Font style

The font style of the element in the diagram.

Background color

The background color of the element in the diagram.

Border color

The border color of the element in the diagram.