FlowSwitch

The Flowswitch activity is a conditional node that provides branching for the flow of control based on match criterion when more than two alternative branches are required.

This activity can be used in combination with other activities like assign, flowdecision.

Technical Reference of FlowSwitch (Fig 1.1)

 

 

 

 MISC

Display Name: Displays the name of the activity. You can also customize the activity name to help troubleshoot issues faster. This name will be used for logging purposes.

Expression: This indicates the name of the variable given in the variable box of the Flow Switch property. This is a mandatory field to execute the workflow.

* Mandatory fields to execute the workflow.

Flow switch variable box (Fig 1.2)

Highlight the Flowswitch box and Select variables option below. Choose a variable for the value that you are going to enter and select the variable type from the drop down.

In the property box of the FlowSwitch activity enter the same variable in the Expression box that was entered in the variables section

The following activity illustrates how we are going to use the FlowSwitch activity along with an assign activity. It shows if the given number goes through the FlowSwitch and declares the right value.

Example:

1.     Drag and drop an assign activity from Primitives. Select the assign activity and choose the variables option. Choose the variable option, assign the variable “int” and select “int32” as the variable type.

2.     Enter any number against the Int in the assign activity box. (Here we will use 10 and 4) to see the difference in output.

3.     Connect the assign activity to a FlowSwitch box which is used to handle multiple scenarios based on a single input. Enter the variables to the flow switch property box as shown in Fig 1.1 and 1.2

4.     Pull as many writeline activity boxes as required and connect it to the switch box.

5.     One of the writeline box should always be set as default for the action to execute. In this activity we choose one box as default and enter the VB expression as “Given Value is not Found”.

6.     Select the other boxes and enter the VB expression as required. For e.g., Value is 9, Value is 10, Value is 19 etc.

7.     Each arrow that connects the write line activity and Switch box has a number in circle that is placed on the arrow by the system itself. This is just a box for reference. Select the default circle and go to the property box and check the InDefaultCase box.

8.     Execute the workflow

When the number entered on the assign tab is 10, The bot gives a message in the output box that the “Value is 10”

When the number entered on the assign tab is 4, The Bot gives a message in the output box that the “Given Value is not Found”