Performing confirmation by using Confirm activity

Like performing compensation, we can also perform confirmation by explicitly using a Confirm activity. Confirmation will also be triggered when workflow is successfully finished.

How to do it...

  1. Create a Workflow Console Application project:

    Create a new Workflow Console Application project and name it UseConfirmActivity.

  2. Create workflow code:

    Add a new class file to the project and name it ConfirmationWorkflow.cs. Then fill the file with the following code:

    using System; using System.Activities; using System.Activities.Statements; namespace UseConfirmActivity { class ConfirmationWorkflow { public Activity GetInstance() { Variable<CompensationToken> token = new Variable<CompensationToken>(); Activity ...

Get Microsoft Windows Workflow Foundation 4.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.