Taking logic decisions with conditional paths
In this part of the chapter we will learn how to code decisions based on data criteria and conditions.
Often, in our actions, we need to make decisions. This decision-making can be done through two artifacts:
- If – In the case of If, there are two possible outputs: true or false for the condition being tested. An interesting feature is that we can change the branch from true to false (false is automatically changed to true). Just right-click on If and select Swap Connectors. The Ifs can be nested (putting Ifs inside each other in branches when required), although when increasing complexity is an issue, it is advisable to use the Switch artifact:
- Switch – With Switch, we have multiple outputs (which allows us to test multiple conditions), and we can define how many we need. The operation consists of cases (if...