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:
- 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.
- 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. |
- For each invoke activity in this microflow, proceed as follows:
- Click the Compensation tab in the properties
area.
- Browse to a reference partner, and select an appropriate operation
to store the original condition of the activity.
- 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.