The purpose of compensating logic is to undo work that was committed in one or more previous steps within the process. This is a manual process that can be added to the process where appropriate.
Note: The constructs for compensations require both a Compensate in the complex activity and a Compensation Handler node attached to the outside of the complex activity.
A compensation flow outside of the normal activity flow defines the rollback of performed activities.
Example 1 - Compensate Due to Error
Your business process is composed of three activities followed by a call to a database for another operation. Build compensating logic that undoes all of the work associated with the three activities so that if an error is returned from the database service transaction, The specified activities in the business process will be rolled back.
Note: You will have to manually roll back any operations performed outside of Unwired Orchestrator.
Example 2 - Compensate by Decision
Your business process checks the status on a customer before submitting a purchase order and sending the ordered items to the customer. Build a compensating activity to handle the rollback of activities already performed (such as returning inventory) if the status of the customer comes back as having not enough credit for the purchase. The compensating activity would not be initiated if the new customer has good credit.
See Setting Compensation.