| Reference > Rule Languages > Business Action Language > BAL Constructs > if |
if |
PREVIOUS NEXT |
Introduces the part of the rule in which you can define conditions.
if
<condition>*
The if part of a rule contains one or more condition statements. If the conditions in the if part are met, the actions in the then part of the rule are executed. The if part of a rule is optional. If there is no if part, all actions in the then part of the rule are performed each time the rule is executed.
If the conditions in the if part of the rule are not met, the actions in the else part of the rule are executed. If the conditions are not met and the rule does not have an else part, the rule does nothing.
The following rule shows how to test the age of a customer in a condition, then execute an action if this test is true.
if the age of the customer is less than 18 then apply 10% discount to the shopping cart of the customer
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |