Control Flow-Switch<T>

Switch<T>

When to use Switch<T>

Use this activity when you want to select one choice from several activities to execute, based on the value of a given expression of the type specified in the object type specifier. 

Figure 1

switch1

Multiple cases can be added if the case keys are not duplicated. Otherwise, an error dialog displays ,reporting the specified case key already exists and that you must choose a different key. In the Switch<T> designer, only one case area can be in expanded view at a time. If a case area is in collapsed view, clicking the case area expands it. Notice that for a collapsed case, the designer shows the display name of the activity inside the case on the right side if there is any. Otherwise, it shows the Add an activity button that expands the case if you click it and lets you add an activity.

Figure 2

switch2

Release date
Version
v4.0.0