Table of Contents

Search

  1. Preface
  2. Part 1: Using Process Developer
  3. Part 2: Creating and Modifying Processes
  4. Part 3: Functions, Events, Errors, and Correlation
  5. Part 4: Testing and Deployment
  6. Part 5: Process Central and Process Server (On-Premises)

Process Developer

Process Developer

What is Compensation

What is Compensation

Compensation enables a business process to define an activity at the scope or process level whose execution serves to reverse some previously executed application logic. There is no automatic restoration of data during compensation. It is up to the application to define its own compensation behavior. Some examples of compensation are cancelling a reservation, putting an order on hold, or removing a charge on a credit card.
A business process can continue running even if part of it must be reversed. The following illustration shows an example of an onEvent part of an Event Handler causing the business process to cancel an inventory order and send out an order cancellation notice. The activities of an already completed scope are the ones that are compensated.
1
When the event handler receives an order cancellation message, it throws a fault to the fault handler
2
The fault handler executes a compensate activity for the previously completed scope that it is linked to
3
The compensation handler for the completed scope rolls back the work of the InvokeOrderInventory service
Compensation handling is associated with a scope. A scope can be thought of as a logical unit of work, with a set of activities that may need reversal, and perhaps retrying, while other parts of the process can continue normally. The compensation actions might need to run in the same order as the original actions.
Compensation and the State of Variables
The compensation handler, if invoked, sees a frozen state of locally defined scope variables as they were when the scope being compensated was completed. If the scope executed multiple times in a loop, then each compensation instance records the values of the local variables at the time of the scope's completion.

0 COMMENTS

We’d like to hear from you!