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

Using the Pick activity

The Pick activity in WF4 is similar to the Listen activity in WF3. This activity will execute one of its parallel subactivities, and only one of its activities will be executed before the Pick activity completes. Typically, we use Pick to set up a time-out for an activity.

How to do it...

  1. Create a workflow project:

    Create a new Workflow Console Application and name it UsingPickActivity.

  2. Create a workflow:

    Create a workflow as shown in the following screenshot:

    How to do it...

    Tip

    We are not allowed to define variables in the Pick activity scope.

    Set the Properties of the Delay activity of Branch1:

    Set the Properties of the Delay activity of Branch2: ...

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