The Switch operator is an extended version of the IF ("If ... then ..." condition).
If the IF statement has only two outcomes - True or False (green or red branches), then Switch has the ability to choose several options. In the absence of the desired option, the cube will be released on the “Default” branch.
Via the context menu Add Action → Logic → Switch
Or use smart search .
Choosing an option from the list
Checking for a specific occurrence (match)
Here you need to specify the variable that we will check
Starting from version 7.4.0.0, you can immediately create a variable from this field (before that you could only select from the existing ones). |
Here you need to specify the exit conditions. The value from the variable will be compared with each of the conditions and, if a match is found, it will be released on the corresponding branch.
As a condition for the exit, you can use not only hard-coded text, but also variables:
If no matches are found, the action will be released on the Default branch.
If the Default branch is not connected to any of the actions and execution falls on it, then the action will fail.
If the Default branch is not connected to any of the actions and execution falls on it, then the action will fail.
Imagine a situation in which we have a value for the switch_test variable.
Next, let's create operations Notification (Notification / Logging) for each of the options.
Example video
bandicam 2020-08-06 22-36-18-491.mp4You can implement similar functionality via C# C# code (C sharp code .net) Sample code for the option above
|