Skip to Content
Microsoft Windows Workflow Foundation 4.0 Cookbook
book

Microsoft Windows Workflow Foundation 4.0 Cookbook

by Andrew Zhu
September 2010
Intermediate to advanced content levelIntermediate to advanced
272 pages
5h 16m
English
Packt Publishing
Content preview from Microsoft Windows Workflow Foundation 4.0 Cookbook

Performing manual compensation by using Compensate activity

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.

How to do it...

  1. Create a Workflow Console Application project:

    Create a new Workflow Console Application and name it UseCompensateActivity .

  2. Create workflow code:

    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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Essential Windows Workflow Foundation

Essential Windows Workflow Foundation

Dharma Shukla, Bob Schmidt

Publisher Resources

ISBN: 9781849680783Other