Compensating a microflow

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

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:
  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. Choose a setting for Compensation Sphere. 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.
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.
Related concepts
Best Practice: Choosing the appropriate compensation for your process
Related tasks
Using a fault handler
Compensating activities in a long-running process
Typing fault variables

Feedback
(C) Copyright IBM Corporation 2005, 2006. All Rights Reserved.