Creating a Compensation Handler

Compensation handling lets you develop a compensating sequence of activities in a business process when a fault or error occurs. This compensating sequence of activities is contained within a compensation handler. Each complex activity can contain a single compensation handler. For more details, see Compensation Handling.

This task provides a simple example of how to set up a compensation handler.

To create a compensation handler:

  1. Create a Business Process Service.

  2. Build a complex activity.

  3. Connect the complex activity to the Receive activity.

  4. Click Maximize in the title bar of the complex activity.

    The complex activity canvas expands to the size of the editor.

  5. Drag an activity from the Tool Palette and drop it into the complex activity. For this example, drag Assign from the Activities tool palette.

  6. Connect the Start activity to the Assign activity.

  7. From the Exception Processing tool palette, select the Compensation Routine and drag and drop it into the complex activity.

  8. Click Maximize in the title bar of the Compensation Routine.

    The compensation routine canvas expands to the size of the editor.

  9. Drag an activity from the Tool Palette and drop it into the complex activity. For this example, drag Assign from the Activities tool palette.

  10. Define the Assign..

  11. Click Minimize in the title bar of the both the compensation handler and the complex activity.

  12. Select File|Save from the main menu bar.

    The compensation handler is complete.

Next: Invoke the compensation handler

Using Connectors

Using Assign

Fault Handlers

Activities Tool Palette

Exception Processing Tool Palette

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com