共用方式為


Using the CompensationHandlerActivity Activity

The CompensationHandlerActivity is a wrapper for one or more activities that perform compensation for a completed ICompensatableActivity. Only activities that implement the ICompensatableActivity interface can be compensated. The two Windows Workflow Foundation out-of-box activities that implement the ICompensatableActivity interface are CompensatableTransactionScopeActivity and CompensatableSequenceActivity. You can also write custom activities that support compensation using the ICompensatableActivity interface.

A CompensationHandlerActivity activity can contain a CompensateActivity activity. For information about how to use the CompensateActivity activity, see Using the CompensateActivity Activity.

For more information, see the CompensationHandlerActivity class of the System.Workflow.ComponentModel namespace in the Windows Workflow Foundation Class Library reference.

For a code sample that demonstrates how to use the CompensationHandlerActivity activity, see Using Compensation.

See Also

Reference

CompensationHandlerActivity
ICompensatableActivity
CompensatableSequenceActivity
CompensatableTransactionScopeActivity

Concepts

Using the CompensateActivity Activity
Using the CompensatableSequenceActivity Activity
Using the CompensatableTransactionScopeActivity Activity
Compensation Overview

Other Resources

Compensation Sample
Windows Workflow Foundation Activities