CompensableActivity Activity Designer

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

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 Toolbox. To open Toolbox, select the Toolbox tab on the left side of the Workflow Designer. Alternatively, select Toolbox from the View menu, or press Ctrl+Alt+X.

The CompensableActivity activity designer can be dragged from Toolbox and dropped on to the Workflow Designer surface. You could drop the activity designer inside a Sequence. Dropping the activity designer creates a CompensableActivity activity with a default DisplayName of CompensableActivity. Edit the DisplayName value in the header of the CompensableActivity activity designer. It can also be edited 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 Toolbox into the Body box on the CompensableActivity activity designer. Add the hint text "Drop activity here".
CancellationHandler False Specifies the activity that is executed when there's a cancellation. To add the activity, drop its designer from Toolbox into the CancellationHandler box on the CompensableActivity activity designer. Add 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 Toolbox into the CompensationHandler box on the CompensableActivity activity designer. Add 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 Toolbox into the ConfirmationHandler box on the CompensableActivity activity designer. Add hint text "Drop Activity Here".

See also