You are not looking at the latest version of the documentation. Check it out there.

General

Sub Process types

BPMN allows model decomposition, encapsulation and detail hiding through the use of Sub Processes. These can be defined in a diagram, allowing the details of a process to be hidden from the top level process.

BPMN 2.0 has two methods for creating sub processes:

  • BPMN Sub Processes, which allow you to create a sub process as part of your process diagram. Sub processes can be nested to contain other sub processes. All sub processes must be contained in the same diagram as their parent Process, and
  • BPMN Call Activities, where one diagram is able to call a process or part of a process definied in a different diagram. This facilitates process decomposition and re-use of common processes / sub-processes by multiple diagrams.

Flows for APEX now allows you to create both sub processes within your process diagram, and callActivities to call other process diagrams. Sub processes can contain other sub processes, and so a deeply nested hierarchy of processes and sub processes can be built.

This page documents sub Processes. Call Activities are documented on this page.

All sub processes currently are embedded sub processes. Global sub processes, which can be called from a different diagram, are supported using Call activities.

Nested Sub Processes

Creating Sub Processes

Sub Processes are created using the modeler, as usual.

Boundary Events on Sub Processes

Starting with Flows for APEX V5.0, Sub Processes can have Timer, Error ad Escalation Boundary Events added to them. See [Boundary Events]((https://flowsforapex.org/development/boundary-events/)

Terminate End Events in Sub Processes

Starting with Flows for APEX V5.0, a Sub Process can contain a Terminate End Event. If a Terminate End Event is reached, all processing in the sub process, along with any processing in nested child sub processes running inside it, are terminated. Control passes to the next event in the normal exit path to the sub process in its immediate parent process.

Rules for Sub Processes

1. Sub Processes must have a single Start Event.

A Sub Process must start with a single Start Event, which should be a simple Start Event (i.e., without any associated Timer, etc. event).

2. End Events

A sub process must have at least one End Event. If more than 1 end events are specified, the sub Process waits for all active subflows to complete before returning to its parent process. (It may have additional non-standard end events, such as error end events, etc.).

3. All Sub Processes are currently Embedded Sub Processes and Operate in a Single Lane.

As is correct for an embedded BPMN sub process, a sub process must operate in a single lane. All sub processes are currently embedded sub processes - callable sub processes are not yet supported.

4. Event Sub Processes are not yet supported.

5. Sub Processes and Subflows.

When a subflow reaches a Sub Process object, the subflow gets a status of ‘In Subprocess’.

Processing in the SubProcess starts on a new subflow, which is running at the subprocess level.

Subflows inside a sub process can themselves split at parallel or inclusive gateways, creating new subflows running at the sub process level. They can also start a new child sub process – in which case the new parent sub process gets status ‘In Subprocess’, and its new child starts new subflows at the new sub process level.

For a sub process to complete normally, all subflows running at the subprocess level must complete by reaching end events. When the last running subflow in a process level completes normally, the subprocess has completed, and processing continues on its parent subflow.

If a subflow triggers a non-interrupting boundary event, it will cause a new subflow to start on its parent’s process level.

If a subflow triggers an interrupting boundary event, for example an error event or an interrupting timer or interrupting escalation, all processing inside the subprocess is stopped, and the subprocess’ parent subflow continues on the path forward from the boundary event, if defined.