September 2010
Intermediate to advanced
272 pages
5h 16m
English
In a certain workflow execution phase, we may want to compensate an activity manually (rather than driven by an exception/error)—a Compensate activity will handle this job.
Create a new Workflow Console Application and name it UseCompensateActivity
.
Add a new class file to the project and name it CompensationWorkflow.cs. Fill the file with the following code:
using System; using System.Activities; using System.Activities.Statements; namespace UseCompensateActivity { class CompensationWorkflow { public Activity GetInstance() { Variable<CompensationToken> token=new Variable<CompensationToken>(); Activity workflow ...