Pick Activity Designer

The Pick activity provides event-based control flow. The activity executes one of several branches in response to a triggering event.

The Pick Activity

A Pick activity contains a collection of PickBranch objects, one of which the Pick activity can execute due to some incoming event that serves as a trigger. In this way Windows Workflow Designer provides event-based control flow modeling. Each PickBranch contains a Trigger and an Action. At the beginning of a Pick activity’s execution, all the trigger activities of the PickBranch elements are scheduled. When the first activity completes, the corresponding action activity is scheduled, and all other trigger activities are canceled.

How to use the Pick Activity Designer

The Pick activity designer can be found in the Control Flow category of the Toolbox, which is accessed by clicking the Toolbox tab on Workflow Designer (Alternatively, select Toolbar from the View menu or CTRL+ALT+X.)

The Pick activity designer can be dragged from the Toolbox and dropped on to the Workflow Designer surface wherever activity designers are normally placed, for example inside of a Sequence activity designer. After dropping it into Workflow Designer, it creates a Pick activity, which by default contains two empty PickBranch activities as elements with display names of Branch1 and Branch2. These respective DisplayName property values can be edited in the PickBranch activity designer header or within the Properties window for each branch.

There are two ways to add PickBranch activities to the collection of a Pick object: dragging and dropping the PickBranch designer from the Toolbox or by using the context menu from within the Pick design surface. For details, see the PickBranch Activity Designer topic. Notice that the only item that can be placed inside a Pick activity designer is a PickBranch activity designer.

Pick Activity Properties in the Workflow Designer

The following table shows the Pick properties and describes how they are used in the designer. These properties can be edited in property grid or on the designer surface.

Property Name Required Usage

DisplayName

False

Specifies the friendly name of the Pick activity designer in the header. The default value is Pick. The value can be edited in the property grid or directly on the header of the activity designer.

Although the DisplayName is not strictly required, it is a best practice to use one.

See Also

Other Resources

Control Flow Activity Designers
Pick Activity
Using the Pick Activity