Error event in a transaction subprocess

1. Overview

When modelling transaction subprocesses, if the subprocess ends with an Error Event, then the transaction results in an error. Such an error is not processed within the subprocess, and the transaction cuts without any compensation. The parent process countinues with an Error Boundary Interrupting Intermediate Event on the boundary of the transaction process.

Within the modelling 2 types of Error Event are used:
  • Error End Event — an event that is modeled when a transaction process ends with an error. When an Error End Event appears, all active flows of the process end, and the error is caught by Error Boundary Interrupting Intermediate Event.

  • Error Boundary Interrupting Intermediate Event — an event that is modelled on the boundary of a transaction subprocess as a catch Error event. Such an event is initiated when a transaction ends with the Error End Event element.

2. Modelling and configuring Error Event when working with transaction subprocess

2.1. Modelling and Configuring Error End Event

To model and configure an Error End Event, take the following steps:

  1. Model Parent business process.

  2. Model transaction subprocess with all necessary activities.

  3. In the transaction subprocess, add an end event for the alternative sequence flow.

    error3 1

    error3 2

    error3 3

  1. Select the end event in the alternative branch of subprocess, click the key icon, and select Error End Event in the configuration.

    error3 4

    error3 5

  1. On the right panel, open the General folder and configure the element:

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

    • In the Name field, enter element name. For example, credit card is NOT valid

  2. Expand the Details block by clicking the plus icon (+).

    error3 6 * In the Name field, enter error name for the database. For example, cardNotValid. * In the Code field, optionally, enter the variable of error code. For example, InvalidCreditCard. * In the Global Error referenced field, select the link to error element. For example, cardNotValid (code= InvalidCreditCard).

    +

    The value in this field is set automaticallu, and corresponds with the Name field error name value.

    If the error code variable is also set, then the value will be set automatically in the Global Error referenced field, linked to the Code field.

  • Optionally, enter error data for the database in the Message field.

    error3 7

2.2. Modelling and configuring Error Boundary Interrupting Intermediate Event

Continue the modelling of transaction subprocess:

  1. On the transaction subprocess boundary, add an intermediate event for the alternative sequence flow. To do that, on the left panel select Create Intermediate/Boundary Event element and place it on the boundary of transaction subprocess container.

    error3 8

    error3 9

  2. Select the boundary event modelled on subprocess boundary, click the key icon and select Error Boundary Event in the configuration.

    error3 10

    error3 11

  3. On the right panel, open the General folder, and configure the element:

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

  • In the Name field, enter element name. For example, Error charge credit card

  • Expand the Details block by clicking the plus icon (+).

    error3 12

  • If the error is initiated by Error End Event element, select a link to the caught error element in the Global Error referenced field. Name and Code fields will be filled automatically.

    The value in Global Error referenced must be identical for all linked elements: error send and catch elements.

    error3 13

  • If the Error Event is initiated by a business logic error during the execution of a business process, perform the following:

  • in the Code Varuable field, define the constant or JUEL-function that contains error code;

  • in the Message Variable field, define the constant or JUEL-function that contains error data.

    You can initiate Error Event by generating an Error Event in a defined process, or via `Delegation Code'. Another way to define an error is to set a type of any Java exception as an error code.

    error3 15

    Connection error happens when a transaction process has an unprocessed error (for example, an invalid receipt number) that doesn’t allow the debit and credit operation subprocesses to continue. In this case, a subprocess ends without compensation.

    The database performs a rollback, and the process continues via Credit Error event.

    Exception processing is performed via via Credit Error event. Cancel event flow goes as follows:

    • Attempt to perform debit from client account, but the server doesn’t respond. The UI generates error result, and Error Boundary Event starts.

    • The process continues with Perform phone transfer.

  1. Complete the modelling of parent process and all alternative sequences of the transaction process.

    error3 16