Compensate activities provide business process logic to undo or compensate for completed logic occurring within a complex activity in a business process service that has encountered some exception. A complex activity can contain only one compensation routine.
They can be invoked explicitly or implicitly when a complex activity has completed.
Compensation routines are explicitly invoked if a fault handler contains a compensate activity. The compensate activity is used to invoke a compensation routine on all inner complex activities that are direct children. Alternately, a compensate activity can be used to explicitly invoke the compensation routine on any single complex activity that is a descendent.
Compensation routines are implicitly invoked if the complex activity encounters an unhandled exception. In this case compensation routines are invoked on all complex activities that are direct children. Invocation of a compensate activity within a complex activity that does not have a compensation routine defined results in the implicit invocation of the compensate call on that complex activity.
Compensation routines are invoked in the reverse order of how the complex activities completed. A compensate activity contains a snapshot of the variables within its scope at the time the complex activity completed. The compensate activity within a specific complex activity is invoked for each successful completion of the complex activity.
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com