pp108 : Transaction

Transaction

This topic describes a Transaction group construct.

A Transaction is a BPMN group construct and is defined as a set of activities or sub-processes that must be executed either entirely or not at all. Thus, in a Transaction, either all operations are committed or all operations are rolled back. A Transaction therefore, can be considered to be a single unit of work. This group construct is used when either all the activities within the transaction should be executed once or none at all. Transaction is graphically represented as follows:

Example of a Transaction

An order processing process comprises the following steps:

  1. Customer enters order details.
  2. Stock inventory is verified to know if the order placed by the customer can be processed.
  3. If stock exists, update requested quantity.
  4. Generate invoice and update Accounts Receivable.
    In this process, consider a scenario where the stock quantity in the inventory is updated, but the generation of invoice and updating of Accounts Receivable fails. In this case, either all the steps should be executed or none at all. To ensure this behavior, these activities can be grouped as a transaction. Thus, in case an exception is raised for any single operation, the entire set of activities will be rolled back.
    Note: For a transaction to work in a sub-process, we need to define the transaction in the sub-process too.

Related tasks

Setting the Properties of a Transaction