any of the following conditions is true

This construct groups conditions together such that the combined statement evaluates to true if one or more of the listed conditions evaluate to true.

Purpose

The construct any of the following conditions are true provides a more compact and convenient alternative to the logical operator or when you want to combine multiple conditions. The resulting statement is considered true if at least one of the listed conditions is true.

Syntax

any of the following conditions is true:
    - <condition>* [,]

Description

This is equivalent to writing if <condition 1> or <condition 2> or ... <condition n>. However, if you have a large number of conditions, using the any of the following conditions is true construct can make the rule more readable.

The construct must be followed by a colon and one or more condition statements, each one on a separate line and preceded by a dash. Note that the dash that precedes each condition must be a ‘short dash’.

Optionally, you can add a comma after the last condition statement in the list to signify the end of the list of grouped. This will separate those conditions that form part of the construct from any additional condition statements that might follow.

Note: Indentation in rules is for readability only; it does not influence the way the rule is processed.

Example

This example shows how to test if a customer is a Gold member or a senior customer.

if
   any of the following conditions is true:
       - the category of 'the customer' is Gold
       - the age of 'the customer' is more than 60
then...

The following more complex example shows the use of a comma to mark the end of a group of conditions. In this example, the purchase must be over $50, the customer must be either a Gold customer or a senior customer, and the purchase must be shipping to NJ.

when a purchase event occurs, called 'the purchase'
if
   all of the following conditions are true:
     - the total amount of 'the purchase' is greater than $50
     - any of the following conditions is true:
        - the category of 'the customer' is Gold
        - the age of 'the customer' is more than 60,
      - the shipping address of 'the purchase' is in NJ
then...

Without the comma to mark the end of the any of the following conditions are true block, the final condition (the shipping address of 'the purchase' is in NJ) would be considered part of the previous group, and the rule would be interpreted to mean that the purchase must be over $50 and (either the customer is a Gold customer or a senior customer or the shipping address is in NJ).