Add a Switch action to a task
This action specifies the path a flow takes depending on what, if any, pre-defined constraints the call meets. This action is similar to a Decision action, and is easy to set up if you have a situation that requires an evaluation of more than one condition. This action is only available in tasks.
- From the Architect home page, click or hover over the Flows menu and select the desired flow type.
- Create a new flow or select an existing one. The flow’s configuration page opens.
- Select the task and click Click to open. The task editor opens.
- From the task editor Toolbox, expand the Logical category and drag a Switch action to the appropriate location in the call flow menu.
- In the Switch action design area, in the Name field type a meaningful name for the switch action. This name becomes the name of the Switch action in the task editor.
- In the Evaluation area, do one of the following:
- Select Take path of first case that returns True to direct Architect to follow the path the first time that a condition returns a value of True and then continue through the flow.
- Select Take path of first case that matches the below expression to direct Architect to follow the path the first time that a condition equals a specified expression and then terminate the switch action.
By default, the Switch action presents Boolean expression configuration. However, when you select the expression type, you can use any expression as long as the expression type matches the case statement. When you create a Switch action using an expression as the evaluation style, consider the following:
- Expression types must match cases types. A Boolean expression must have Boolean cases, a String expression must have String cases, and so on.
- If the expression type for the expression to be evaluated changes, a Change cases to button appears. Depending on the type of expression, this button label varies.
- For cases in Literal mode, when you click the Change cases to button Architect resets all previously entered values. Use caution before clicking this button. Values entered in Expression mode remain intact unless you switch to Literal mode.
- When you click the Change case to button, the Case value boxes change to accept entries for the selected expression variable.
- If you chose to take the path of the first case that matches a predefined expression, in the Expression box enter the desired expression.
- To add additional cases beyond the default and three displayed cases, click Add Case button.
- For each case, do the following :
- Switch to expression mode.
- Enter the expression that will evaluate to True or False.
- Open the large expression editor to enter more detailed expressions.
- In the task editor, complete the Switch action by adding the appropriate action based on each case result.
- (Optional) Use the up and down arrows to arrange the order of each case.
- To delete a case, click x.
- Continue building the task per your call flow design.