Rule
The most basic construct in the Rule Language is the rule. The rule consists of a condition followed by one or more actions. The condition part starts with the “IF” keyword and the action part – with the “THEN” keyword. Therefore most rules look like this:
If Condition Then Action
For example,
IF Policy.Driver.Age > 70 THEN Policy.Premium = 300
If Account.State='CLOSED' AND Account.Balance<>0 Then
REPORT ERROR 'Account with non-zero balance cannot be closed'
As seen from the examples above both the condition and action parts of a rule may refer to a business object (or business object group or notification) and its attributes. Business objects are referred to by name, for example Account. Attributes of a business object are referred to by the attribute name where the name of the attribute is separated from the name of the business object by a dot symbol, for example Account.State.
NOTE: The condition part of a rule may be omitted. A rule without a condition is called an unconditional rule – it consists of one or more actions only, for example:
CreditAccount.AvailableFunds=CreditAccount.CreditLimit + CreditAccount.Balance - CreditAccount.NonClearedFunds
NOTE: A rule may also include the “ELSE” part which specifies what should happen if a condition does not hold, for example:
IF Policy.Driver.Age > 70 THEN Policy.Premium = 300
ELSE Policy.Premium = 250
or
IF Policy.Driver.Age > 70 THEN Policy.Premium = 300
ELSE If Policy.Driver.Age > 80 Then Policy.Premium = 350
ELSE Policy.Premium = 250