Description |
Used with the Select/End Select action, the Case/End Case action is part of the Select/End Select action combination, which is a very useful alternative to using the If action. Like the If action, the Select/End Select action allows decisions to be made during the execution of the Workflow depending on the result of an expression evaluation. The difference is the speed and readability of the resulting Workflow when one of several decisions is reached. For example, for a simple expression such as: 1=1 (true) or 1>2 (false), it would be best to use the If action. For more complex decisions where there are several possible answers such as favoritecolor=red, blue, green or yellow, the Select/End Select action would be a better choice. This is because the Select/End Select action presents the Workflow steps in a manner that is more readable and at runtime, the evaluation of the expression occurs only once rather than needing repeated If actions with individual comparison. The Select/End Select action works by first using a Select statement with the expression to evaluate, for example %Day()%, which returns a number between one and seven depending on the current day. Immediately following the Select statement are the individual Case statements that segregate the Workflow steps to run for each case that the Select statement could return. The last Case block can optionally be what is called a "default case" which defines a block of steps to execute if anything other than the defined cases is returned. The Case statement must be closed with an End Case statement</AMCASE>. The End Case statement has no parameters. |
Declaration |
<AMCASE CONSTANT="text"></AMCASE> |
Example |
The following example can be cut and pasted directly into the Designer. <AMSELECTCASE EXPRESSION="%Weekday(Now())%"> |
General Tab Parameters |
Case/Default
case: Specifies the name of the expression that the Select/End Select action evaluates. Click the
Expression Builder icon Text, Required |