This topic applies only to the IBM Business Process Manager Advanced configuration.

Compensating a microflow

In a microflow, the entire process executes within a single transaction. To set up compensation for a microflow, you store the original properties for each of the invoke activities within the microflow so that the original data can be restored if the process cannot be committed and must be rolled back.

About this task

If this microflow fails, the runtime engine crawls back through the invoke activities in reverse order, and restores each to its previous state. To create compensation logic for an invoke activity in a microflow, you must define a location to store the details of this state. To do this, proceed as follows:

Procedure

  1. To begin, you will have to make this a microflow. To do this, click an empty area of the canvas, click the Details tab in the properties area, and clear the Process is long-running check box.
  2. Configure the Compensation Sphere setting. You have the following two options:
    Option Description
    Supports Use this setting when this microflow can run without a compensation service.
    Required Use this setting when this microflow needs a compensation service.
  3. For each invoke activity in this microflow, proceed as follows:
    1. Click the Compensation tab in the properties area.
    2. Browse to a reference partner, and select an appropriate operation to store the original condition of the activity.
    3. Browse to an input variable to store the original value of the activity.
    In the event that the microflow has to be compensated, it will look at these values, and restore them to the activity.

Results

If this microflow is called or invoked by a larger long-running process, the compensation values for each activity are promoted to the parent process and stored there in case it fails, and the process as a whole must be compensated.