Adding Compensatable Activities and Compensation Handlers

When you perform workflow changes that involve compensatable activities and compensation handlers, you should consider the effects of the changes.

Adding Compensatable Child Activities

If you add a compensatable child scope to a surrounding compensatable scope that has been completed, and if the surrounding scope later compensates:

  • The child scope does not pass through the compensating state.

  • The child’s compensation handler (whether default or explicit) is not invoked.

Removing Compensatable Child Activities

If you remove a compensatable child scope from a surrounding compensatable scope that has been completed, and if the surrounding scope then compensates:

  • The child scope does not pass through the compensating state.

  • The child’s compensation handler is not invoked

Adding Compensation Handlers

If you add a compensation handler to a scope that has been completed, and an attempt is made to compensate that scope:

  • If the scope has no compensatable children:

    • The scope does not pass through the compensating state.

    • The new compensation handler is not called.

  • If the scope has compensatable children:

    • The scope passes through the compensating state.

    • The new compensation handler is called.

Removing Compensation Handlers

If you remove a compensation handler from a scope that has been completed, and an attempt is made to compensate that scope:

  • If the scope has no compensatable children:

    • The scope passes through the compensating state.

    • The old compensation handler is not called.

  • If the scope has compensatable children:

    • The scope passes through the compensating state.

    • The old compensation handler is not called.

    • The compensatable children are default-compensated.

See Also

Reference

WorkflowChanges

Concepts

Compensation Overview
Workflow Changes Overview
How to: Apply Workflow Changes to Workflows
Using Workflow Changes in Workflows
Using Compensation in Workflows

Other Resources

Compensation Sample