CompensableActivity Class
An activity that supports compensation of its child activities.
Assembly: System.Activities (in System.Activities.dll)
System.Activities::Activity
System.Activities::ActivityWithResult
System.Activities::Activity<TResult>
System.Activities::NativeActivity<TResult>
System.Activities.Statements::CompensableActivity
| Name | Description | |
|---|---|---|
![]() | CompensableActivity() | Initializes a new instance of the CompensableActivity class. |
| Name | Description | |
|---|---|---|
![]() | Body | Gets or sets the activity that is scheduled when the CompensableActivity executes. |
![]() | CacheId | Gets the identifier of the cache that is unique within the scope of the workflow definition.(Inherited from Activity.) |
![]() | CancellationHandler | Gets or sets the activity that is scheduled when the activity is canceled. |
![]() | CompensationHandler | Gets or sets the activity that is scheduled when compensation is performed on the CompensableActivity. |
![]() | ConfirmationHandler | Gets or sets the activity that is scheduled when confirmation is performed for this CompensableActivity. |
![]() | DisplayName | Gets or sets an optional friendly name that is used for debugging, validation, exception handling, and tracking.(Inherited from Activity.) |
![]() | Id | Gets an identifier that is unique in the scope of the workflow definition.(Inherited from Activity.) |
![]() | ImplementationVersion | Gets or sets the implementation version of the activity.(Inherited from NativeActivity<TResult>.) |
![]() | Result | Gets or sets the result argument for the Activity<TResult>.(Inherited from Activity<TResult>.) |
![]() | ResultType | When implemented in a derived class, gets the type of an activity OutArgument.(Inherited from ActivityWithResult.) |
![]() | Variables | Gets the collection of T:System.WorkflowModel.Variable objects for this CompensableActivity. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | ShouldSerializeDisplayName() | Indicates whether the DisplayName property should be serialized.(Inherited from Activity.) |
![]() | ToString() | Returns a String that contains the Id and DisplayName of the Activity.(Inherited from Activity.) |
CompensableActivity allows a developer to specify a Body activity that defines a long-running task that performs their core business logic. It also allows the developer to optionally specify a compensation and confirmation activity to schedule appropriate business logic in the event of errors or successful completion of the Body. Compensation and confirmation of a CompensableActivity is invoked by using the CompensationToken returned by the CompensableActivity. CompensationToken is an opaque, typed object returned as the P:System.Activities.WorkflowElement`1.Result argument after successful completion of a CompensableActivity activity’s Body. This CompensationToken is used by the Confirm and Compensate activities to explicitly invoke confirmation and compensation of a CompensableActivity. CompensableActivity can be composed in a nested hierarchical fashion in the workflow. For more information, seeCompensation Programming Model.
Available since 4.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


