Combinations of conditions
You can apply conditions to groups, and test nested groups.
You can use logical operators to combine conditions in the if part of a rule.
The following if statement
contains one condition:
if the customer category is Gold
In the following if statement,
the logical operator and links
two conditions:
if the category of the customer is Gold and the customer has been waiting longer than 5 minutes
Precedence of and over or
When the logical
operators and and or link conditions in the if part of a rule, the and operator takes precedence
over the or operator.
Consider
the following if statement:
if the customer is older than 60 or the customer is younger than 21 and the category of the customer is Student
The statement is true if either of the following conditions is true:
- The customer is older than 60
- The customer is younger than 21 and a student
Multiple conditions and parentheses
You can use parentheses to clarify the precedence of logical operators.
In
the following if statement,
parentheses group an age limit with a category:
if the customer is older than 60 or (the customer is younger than 21 and the category of the customer is Student)
You can also use parentheses to change the interpretation of conditions.
In
the following if statement,
the condition in parentheses is met if the customer is a student older
than 60 or younger than 21:
if (the customer is older than 60 or the customer is younger than 21) and the category of the customer is Student
Multiple conditions that use the same logical operator
You can group conditions and apply the same logical operator to all the conditions in the group by using these statements:
all of the following conditions are true: This business term links all the conditions in the group with the logical operatorand.any of the following conditions is true: This business term links all the conditions in the group with the logical operatoror.
In the following rule, the action is done only when both conditions are true:
if all of the following conditions are true: - the category of the customer is Gold - a member of the Gold team is available then redirect the call to a member of the Gold team;
In the following example, the action is done if the customer’s category is Gold or the customer has been waiting for longer than five minutes:
if any of the following conditions is true: - the category of the customer is Gold - the customer has been waiting longer than 5 minutes then redirect the call to a member of the Gold team;