Skip to main content

Creating a Transactional Sub-Process

To illustrate how to configure Transactional Sub-Processes we will use the following diagram:

ConfigurindTransactional8

The diagram refers to a Travel Request Process.

A Travel Request Process includes the necessary Activities to receive and handle travel requests made by the employees of a company. We will transform the Bookings Task into a Transactional Sub-Process, considering situations that need special treatment.

Steps to Configure a Transactional Sub-Process

  1. Go to Step 1 (Model Process) of the Process Wizard and click Edit Process.

    Editaprocess1

  2. Right-click the task you wish to convert to a Transactional Sub-Process.

    • In this case, the Bookings task, and select Transform to Sub-Process.

    ConfigurindTransactional9

  3. The Sub-Process Wizard will launch and show the Sub-Process types.

    • Select the Embedded option.
    • In the new window, select the Transactional checkbox.

    ConfigurindTransactional23

  4. The Properties window will display the following controls:

    ConfigurindTransactional24

    ControlsDescription
    Transactional Check-boxSets the Sub-Process as Transactional.
    ProcessesDisplays the existing processes list and sets the selected one as the Sub-Process.
    Add buttonAllows the user to create a new process.
    Process versionDisplays the selected process versions list. If a new process is created, the selected version will be 1.0.
    DiagramDisplays a preview of the process model selected. If a new process is selected, the Diagram will remain empty.
    Status BarPresents the Sub-Process status configuration horizontally.

Defining the Sub-Process

You can either select an existing Process or create a new one from the Properties tab:

To Set an Existing Process as Transactional:

  • Tick the Transactional checkbox.

  • Click the Process and Process version drop-down lists and select the desired options.

  • Click the Finalize button.

    configureEmbededSubprocess14

To Create a New Transactional Sub-Process:

  1. Tick the Transactional checkbox and click the Add button.

    configureEmbededSubprocess12

  2. Type the name of the new Process.

    configureEmbededSubprocess13

  3. The created Process will be listed in the Process drop-down list. Select it and click Finalize.

    configureEmbededSubprocess15


Editing the Transactional Sub-Process

Once the Sub-Process is created, you can immediately edit it.

  • Right-click the new Sub-Process (Bookings) and select Edit Sub-Process.

    ConfigurindTransactional11

  1. The window will display the Sub-Process diagram.

    • When you create a process for the first time, a pool containing one lane and one phase will be displayed.

    • In the Bookings Sub-Process, the Administrative Department manages the car, hotel, and flight bookings simultaneously as requested by the employee.

    • When the bookings are completed, the Sub-Process ends.

    The process flow is depicted in the following diagram:

    ConfigurindTransactional12


Handling Compensation Events

In this scenario, various situations may arise during the Process.

For example:

  • The Administrative Department may successfully confirm the car and hotel booking.
  • However, when attempting to book the flight, no airline has seat availability for the requested date.
  • Since the car and hotel bookings have already been confirmed, they must be canceled, and the employee notified.

This scenario is modeled as follows:

ConfigurindTransactional13

  • A Compensation Event is attached to the boundary of each booking Activity.
  • This event activates a cancellation flow once triggered.
  • The cancellation flow represents manual Activities that must be performed by a user to resolve the situation.

In the above scenario:

  • The Compensation Events attached to the Car Booking and Hotel Booking Activities will be activated.
  • The Cancel Car and Cancel Hotel Compensation Activities will be enabled.
  • This allows the Administrative Department to handle each affected Activity.

Associating a Compensation Event

  • Right-click the Activity to be compensated and select Attach Event.

  • Choose Compensate event.

    ConfigurindTransactional14

  • The associated Compensation Task is automatically created.

  • Repeat this for the remaining Activities.

    ConfigurindTransactional15


Modeling the Cancellation Flow

To raise the cancellation, we need to use an expression once the activity is finished (on exit) and deviate the normal path towards the cancellation path.

This function will add a cancellation log file in the project folder.
The expression should be created on the fourth step of the Process wizard.

ConfigurindTransactional21


Configuring the Parent Process for Cancellations

If activities are compensated, the case token will not continue through the intended flow.

  • The employee will not be notified of the two successful bookings as they were subsequently canceled.
  • To handle this, we need to create a Cancel Event for the Transactional Sub-Process.
  1. In the parent Process, right-click the Bookings Sub-Process.

  2. Select the option Attach Event.

  3. Choose the Cancel Event.

    ConfigurindTransactional16

  4. The cancellation flow will send a notification to the employee informing them that the booking could not be completed.

  5. Add a Script task to the flow.

    ConfigurindTransactional17

  6. An End Event is used to terminate the Process.


Handling Unexpected Errors

An Error is raised when:

  • Something unexpected happens.
  • There is no defined procedure in place to handle it.

To handle this, we will:

  1. Convert the Flight Booking Activity into an automatic task.

  2. Add an interface to it.

  3. If an error occurs (e.g., connection error), the Sub-Process will terminate.

  4. This will trigger an exception flow in the main Process.

    ConfigurindTransactional18

  5. Finally, include the exception flow in the parent Process.

  6. To catch the error, attach an Error Event to the Bookings Sub-Process.

    ConfigurindTransactional19

  7. The exception flow will notify the Administrative Department of the error.

    ConfigurindTransactional20