Compensating activities in a long-running process

In a long-running process, each transaction is committed individually. To set up compensation, you specify how to deal with each transaction should it need to be compensated if the process fails.

Before you can create a compensation for a process, you will need to identify a few things: To compensate a process, proceed as follows:
  1. To begin, you will have to make this a long-running process. To do this, click an empty area of the canvas, click the Details tab in the properties area, and enable the Process is long-running check box.
  2. Drop either an invoke or a scope activity onto the canvas. Use an invoke if you will be creating a compensation handler for a single activity, or use a scope if it is for a group of them.
  3. Click this activity to launch the action bar.
  4. In the action bar, click the compensation handler icon as shown in this image. The compensate handler in the action bar
  5. Populate the compensation handler with the activities needed to create the compensation logic.
Now, if the process fails anytime after the invoke or scope activities have successfully been committed, then the associated compensation handler will be executed.
Note: A compensation handler will only run if the activity with which it is associated has completely successfully.
Related concepts
Best Practice: Choosing the appropriate compensation for your process
Related tasks
Using a fault handler
Compensating a microflow
Typing fault variables

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