| Reference > Rule Languages > Business Action Language > BAL Constructs > any of the following conditions is true |
any of the following conditions is true |
PREVIOUS NEXT |
Groups together a series of conditions such that the combined statement evaluates to true if one or more of the listed conditions evaluates to true.
any of the following conditions is true:
- <condition>* [,]
The 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.
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.
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 order must be over $50 AND the customer must be EITHER a Gold customer or a senior customer AND the order must be shipping to NJ.
if
all of the following conditions are true:
- the order total 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 is in NJ
then...
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |