Share via


Compensate Activity Designer

The Compensate activity designer is used to create and configure a Compensate activity.

The Compensate Activity

The Compensate activity explicitly invokes the CompensationHandler for an activity contained in a CompensableActivity. If the Compensate activity is not used within the CancellationHandler, CompensationHandler, or ConfirmationHandler of a CompensableActivity, then you must specify the Target property.

The CompensationToken specified by the Target provides a means to explicitly confirm or compensate a CompensableActivity once the Body of the CompensableActivity has successfully completed.

Using the Compensate Activity Designer

The Compensate activity designer can be found in the Transaction category of the Toolbox, which is accessed by clicking the Toolbox tab on the left side of the Workflow Designer (Alternatively, select Toolbar from the View menu, or CTRL+ALT+X.)

The Compensate activity designer can be dragged from the Toolbox and dropped on to the Workflow Designer surface wherever activities are usually placed, such as inside a Sequence. This creates a Compensate activity with a default DisplayName of Compensate. The DisplayName value can be edited in the header of the Compensate activity designer or in the DisplayName box of the property grid.

The Compensate Properties

The following table shows the CancellationScope properties and describes how they are used in the designer. The DisplayName property can be edited in property grid or on Workflow Designer surface, but the Target property must be edited in property grid.

Property Name Required Usage
DisplayName False Specifies the optional friendly name of the Compensate activity. The default is Compensate.
Target True Specifies the InArgument<T> that contains the CompensationToken for this Compensate activity.

See Also

Transaction CompensableActivity Compensate Activity Designer Confirm TransactionScope