What are some business scenarios in which I will use Switch?
- An invoice that has 3 potential statuses (not started, pending, approved) and 3 sets of actions for each one
- A process of automatically ordering raw materials to 4 suppliers based on certain conditions
We use Switch in 2 ways
1) Sequence
2) Flow chart
Difference between Switch and Flow Switch?
- We can use normal Switch is sequence based mechanism. We can drag it into Flow chart. But flow switch cannot be used in sequence.
- Using Flow Switch we can add only 12 cases whereas in Switch we can add unlimited cases
Example:
Step 1: Create Sequence
Step 2:
- Add Input Dialog. And enter the Label and Title
- In the properties panel, put "Result"/output by creating a new variable "FruitName" which is string
- Add Switch.
- Create Case: Apple. Note: Do not add quotes for string
- Create one more case Cherry
- In default add an message box "Did not match any value"
- Inside Apple activity add Message box "You have entered "+ FruitName.to String
- Inside Cherry activity add Message box "You have entered "+ FruitName.to String
Using switch inside Flowchart
Input Dialog box will be
And Switch will be like
No comments:
Post a Comment