Databases Reference
In-Depth Information
The compensation handlers will only be invoked for those scopes which have
completed successfully and will be invoked in reverse order of completion. That is,
the compensation handler for the most recently completed scope will be invoked
first, and then the next most recent and so on.
If a scope whose compensation handler has been invoked contains scopes for which
compensation needs to be performed, then it will need to call the Compensate
activity within its own compensation handler.
Note:
If a scope doesn't have an explicit compensation handler defined for it,
then it will have a default compensation handler that just invokes the
compensate activity.
Adding a Compensate activity
For our purposes, we need to trigger the Compensate activity at the process
level, so to do this, we have defined a fault handler on the process to catch the
invalidUserDetails fault thrown by our previous fault handler.
Once done, we added a Compensate activity as the first activity within our fault
handler. To configure it, double-click the Compensate activity to bring up the dialog
box, as shown in the next screenshot:
Here we have the option of specifying a scope Name to restrict it to invoking the
compensation handler for that scope. For our purposes, we want to invoke the
compensation handler for all top-level scopes, so we have left it blank.
 
Search WWH ::




Custom Search