A Compensation activity within a complex activity enables you “undo” work that was committed in a previous step of the process.
For an overview on how compensation works, see Compensation Handling.
To set compensation:
Open the complex activity in which the compensation is to occur.
Identify the normal activities.
Place the Compensate simple activity at the point where either a roll back of activities is to be performed or the flow continues to the next activity.
Place a decision activity, such as a rule, before the Compensate.
Build the rule that continues the processing down the normal flow of activities.
Connect the False node of the rule to the Compensate activity.
Create a compensation handler to respond to the processing that is to occur if the runtime processing results in the flow being sent to compensation. See Building Handlers.
A compensation flow outside of the normal activity flow defines the rollback of performed activities.