PickBranch Activity Designer

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The PickBranch provides an event-based path of execution within a Pick activity that can be triggered by an incoming event.

PickBranch

PickBranch objects are contained in the Branches collection of a Pick activity. Each PickBranch is contained in a branch of the Pick activity and can be executed due to some incoming event that serves as a trigger. In this way the Workflow Designer provides event-based control flow modeling. Each PickBranch contains a Trigger and an Action.

How to use the Pick Activity Designer

Access the PickBranch designer in the Control Flow category of the Toolbox.

Two empty PickBranch objects with display names of Branch1 and Branch2 are created by default as elements of a Pick activity when the Pick activity designer is initially dropped on to the Workflow Designer. These respective DisplayName property values can be edited in the PickBranch designer header or within the Properties window for each branch.

There are two ways to add PickBranch objects to the collection of a Pick object: dragging and dropping the PickBranch designer from the Toolbox, or by using the right-click menu from within the Pick design surface:

  • The PickBranch designer creates a PickBranch when it is dragged from the Toolbox and dropped into one of the branches of a Pick activity designer on the Workflow Designer surface. The new PickBranch objects can be placed inside the Pick designer to the left or right of any existing PickBranch elements already contained in the collection. When dragging a PickBranch designer onto the Pick designer with a mouse, the Pick designer uses a vertical blue-gray band to indicate where the PickBranch is added for a given mouse placement.

  • Right-click Pick activity designer (but not inside PickBranch designer) to obtain a context menu and select Create Branch to add a new PickBranch. Notice that the new PickBranch is added to the right of the existing PickBranch objects in the Pick designer.

The PickBranch designer can be expanded to reveal the Trigger and Action boxes or collapsed by clicking the double carets on the right side of their headers. Edit the Trigger and Action of each PickBranch by dropping activities into the Trigger and Action boxes of their designers.

The PickBranch objects in the Branches collection of a Pick object, can be reordered by dragging and dropping them to a new location within the Pick designer. The Pick designer uses a vertical blue-gray band to indicate where the PickBranch is added for a given mouse placement.

There are two ways to delete a PickBranch:

  • Select the PickBranch designer and delete it.
  • Select the PickBranch designer, right-click to obtain the context menu and select Delete.

Be sure to select the PickBranch designer, as selecting one of the activities inside its Trigger or Action boxes by mistake deletes one of those activities and not the PickBranch object.

PickBranch Properties in the Workflow Designer

The following table shows the most useful PickBranch properties and describes how to use them in the Workflow Designer.

Property Name Required Usage
DisplayName False The friendly name displayed on the header of the PickBranch designer. The default value is Branch.

Although the DisplayName is not strictly required, it is a best practice to use one.
Trigger True Each PickBranch contains a Trigger action that can invoke the Action.
Action False Each PickBranch contains an Action that is executed if triggered.

See also