CompensableActivity Activity Designer

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

The CompensableActivity Activity

The CompensableActivity defines a unit of work that can be confirmed or compensated after successful completion.

Using the CompensableActivity Activity Designer

The CompensableActivity 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 CompensableActivity 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 CompensableActivity activity with a default DisplayName of CompensableActivity. The DisplayName value can be edited in the header of the CompensableActivity activity designer or in the DisplayName box of the property grid.

The CompensableActivity Properties

The following table shows the CompensableActivity properties and describes how they are used in the designer. The DisplayName and Result property can be edited in property grid but the other properties must be edited on the Workflow Designer surface.

Property Name Required Usage
DisplayName False The optional friendly name of the CompensableActivity activity. The default is CompensableActivity.
Result False Specifies the return value of the CompensableActivity. This property must be edited in the property grid.
Body True Specifies the activity for which the compensation, cancellation, and confirmation logic is provided. To add the Body activity, drop an activity from the Toolbox into the Body box on the CompensableActivity activity designer with hint text “Drop activity here”.
CancellationHandler False Specifies the activity that is executed in the event of cancellation. To add the activity, drop its designer from the Toolbox into the CancellationHandler box on the CompensableActivity activity designer with hint text “Drop Activity Here”.
CompensationHandler False Specifies the activity to be executed when compensating for the Body activity. This handler can be explicitly invoked using the Compensate activity.

To add the activity, drop its activity designer from the Toolbox into the CompensationHandler box on the CompensableActivity activity designer with hint text “Drop Activity Here”.
ConfirmationHandler False Specifies the activity to be executed when confirming the Body activity. This handler can be explicitly invoked using the Confirm activity.

To add the activity, drop its activity designer from the Toolbox into the ConfirmationHandler box on the CompensableActivity activity designer with hint text “Drop Activity Here”.

See Also

Transaction CancellationScope Compensate Confirm TransactionScope