ILOG Rules for .NET User Guides > ILOG Rule Solutions for Office > Writing and editing rules > Write action statements

The action part of a rule describes what to do when the conditions of the rule are met, and in some cases what to do if the conditions are not met. Actions are represented in the Rule Editor by whatever appears after Then and Else.

Note
Every rule must specify at least one action.

For example, in the following rule, a discount of 15% is applied when the value of the shopping cart is more than $100.

 If
     the value of the shopping cart is more than $100
 Then
     apply a 15% discount on the shopping cart;

If there is more than one action to perform, they are carried out in the order in which they appear in the action part.

The Else part of a rule is an optional block of actions that specify what to do when the conditions are not met. For example, in the following rule, a 15% discount is applied when the conditions are met, and a 5% discount is applied when the conditions are not met.

 If
     all of the following conditions are true:
         - the value of the shopping cart of this customer is more than $100
         - the category of the customer is Gold
 Then
     apply a 15% discount on the shopping cart;
 Else
     apply a 5% discount on the shopping cart;

In other words, if the value of the shopping cart is not more than $100 or if the customer category is not Gold, the customer will still receive a 5% discount.

It is also possible to refine the use of the Else part of a rule by setting variables in the Definitions part. This is explained in section Use definitions with the Else part.

See Also

if

then

else