Event subprocess

1. Overview

An Event Subprocess — is a subprocess initiated by an event. It can be added locally within an in-built subprocess. Event Subprocess is initiated on its corresponding start event. A Parent process[1] stops at the point of awaiting subprocess results.

event subprocess 01

Event types

The following events can be used to initiate an Event Subprocess:

Message Event

Message Event — is a business process event used to transfer information from one business process to another one, or a subprocess with a message.

Error Event

During process automation you can often encounter deviations from the standard scenario. One of the ways top fix the deviations is using an Error BPMN-event, which allows the business process model to react to certain errors within task execution.

Error Start Event can only be used to start an Event Subprocess.

You can’t use an Error Event to start a process instance. An Error Start Event is always an interruption event.

2. Modelling a subprocess initiated by Message Event

2.1. Prerequisites

Before starting a subprocess with a Message Event, take the following steps:

  1. Model a Parent Process (which may either start the subprocess, or not).

  1. Optionally, model another process that will start the subprocess.

    The process that sends the message must have a modelled ref:bp-modeling/bp/bpmn/events/message-event.adoc[message sending event] (intermediate or end) to initiate a subprocess (see example below).
  2. Example. Modelling a subprocess initiated by a Message Event.

event subprocess 02

  1. Configure the message sending event:

  • Select the element and navigate to configuration panel.

  • In the Global Message Name and Global Message referenced fields, enter values for Global Message. Global Message referenced is filled in automatically. For example, sendMessagefirst.

    Global Message Name and Global Message referenced values for sending and receiving events must be identical. For the sending element, the values are filled manually. For receiving element, you’ll have to select the corresponding values from dropdown lists.

    event subprocess 03

2.2. Modelling

Once all the prerequisites are met, proceed with the modelling and configuring of the Event Subprocess:

  1. Select the Create expanded SubProcess element on the left panel and drag it to the modelling canvas, inside of the Parent Process pool.

    event subprocess 1

    event subprocess 2

  1. Select the container with in-built subprocess and define subprocess type by clicking the key icon (Change Type) and selecting Event Sub Process.

    event subprocess 3

  1. Select the start event in the subprocess, and define its type by clicking the key icon and selecting Message Start Event (non-interrupting).

    As opposed to the process configuration, subprocess start event is added automatically with the Create expanded SubProcess container.

    The non-interrupting event selection is caused by the fact that selecting an interrupting event, the Parent Event token is nullified right at the start of subprocess, so the Parent Event won’t continue.

    event subprocess 4

  1. Configure the start event that will receive the message in the subprocess:

  • Select the element and navigate to configuration panel.

  • In the Global Message Name and Global Message referenced fields, enter values for Global Message. Global Message referenced is filled in automatically. For example, sendMessagefirst.

    Global Message Name and Global Message referenced values for sending and receiving events must be identical. For the sending element, the values are filled manually. For receiving element, you’ll have to select the corresponding values from dropdown lists.

    event subprocess 5

  1. Connect any intermediate task and end the subprocess.

As a result, the subprocess initiated by a Message Event is modelled and configured.

3. Modelling a subprocess initiated by Error Event

To start a subprocess with an Error Event, an Error Sub-Process Interrupting Start Event is used.

An Error Sub-Process Interrupting Start Event can only be used to start an Event Subprocess, and can’t initiate a process instance. This event is always interrupting.

To model and configure and Error Sub-Process Interrupting Start Event, take the following steps:

  1. Model the Parent Process that ends, for example, with an Error End Event.

    Learn more about modelling and configuring an Error End Event here.
    The Error Sub-Process Interrupting Start Event element can be initiated not only with an Error End Event, but also with a business-error that appeared during the execution of a certain task (service task, user task, etc.) in the Parent Process.
  1. On the left panel, select the Create expanded SubProcess element.

    error2 1

  1. Drag the Create expanded SubProcess to the pool with the Parent Process.

    error2 2

  1. Change the subprocess type by clicking key icon (Change Type) and selecting Event Sub Process.

    error2 3

  1. Select the start event in the subprocess, and define its type by clicking key icon and selecting Error Start Event.

    As opposed to the process configuration, subprocess start event is added automatically with the Create expanded SubProcess container.

    error2 4

    error2 5

  1. On the General tab, configure the element:

    • In the Id field, enter element identificator, or leave default value.

    • In the Name field, enter element name.

  1. Expand the Details block by clicking +.

    error2 6

  • If the error is initiated with Error End Event, then the Global Error referenced field must be filled with the link to error sender element (for example, one modelled and configured on the Parent Process). The Name and Code fields will be filled automatically.

    The Global Error referenced field value must be identical for interconnected elements: error sender and receiver elements.

    error2 7

  • If the error event is initiated by an error within business logic during the execution of a business process, then it’s essential to:

  • In the Name field, set error name. For example, startError.

  • In the Code field, define the type of any Java exception as error code. For example, java.lang.Exception.

    java.lang.Exception definition will catch any logical error that will appear in the Parent Process.

  • The Global Error referenced field value is entered automatically, according to the Name and Code. For example, startError (code=java.lang.Exception).

    error2 8

  • Optionally, in the Message field, enter error data (description) that will be sent by the system.

  • If the error is initiated by a variable, its value can be set in the following way:

    • in the Code Variable field, define a constant or a JUEL-function that includes error code;

    • in the Message Variable define a constant or a JUEL-function that includes error data.

  1. Complete subprocess activity modelling.

As a result, the subprocess initiated by error event is modelled and configured.

  1. Example. Modelling of a process, that starts initiated with by an error event in the Parent Process

error2 9


1. Parent Process is a process that initiates subprocess start. A subprocess is a Child Process to a Parent Process.