O'Reilly logo

Microsoft Windows Workflow Foundation 4.0 Cookbook by Andrew Zhu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Composite activity

There are many built-in composite activities in WF4 such as Sequence, While, Parallel, and so on. Is it possible to create our own composite activity? Well, the answer is we can. For demonstration purposes, we will create a MySequence activity in this task.

How to do it...

  1. Create the MySquence activity:

    Add a new code file to the ActivityLibrary project named MySequence.cs. Then, replace all the default code with the following code:

    using System.Activities; using System.Collections.ObjectModel; namespace ActivityLibrary { public class MySequence:NativeActivity { public Collection<Activity> Activities { get; set; } public MySequence() { Activities = new Collection<Activity>(); } int activityCounter = 0; protected override ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required