Rules
A rule has the following form:
{<boolean-expression> | Rule <simple-identifier> : <boolean-expression>}
Each rule is either named or unnamed. A named rule consists of a simple identifier (the rule’s name) and a boolean expression. An unnamed rule consists only of a boolean expression. Each rule ends with a line break.
When the cost engine evaluates a rule, it evaluates the boolean expression (see Boolean Expressions for information on boolean expression evaluation). For a named rule, the cost engine assigns the value (true or false) of the boolean expression to the rule’s name.
The cost engine, in the course of evaluating a rule’s conditional expression, sometimes evaluates formulas. In particular, if the expression contains an identifier that is not one of the current module’s input identifiers, the cost engine determines the identifier’s value by evaluating the formula (in the current module) that has this identifier as its left-hand side.
There are two possible outcomes of the evaluation:
The conditional expression evaluates to false. In this case, the rule fails. When a named rule fails, the cost engine does all the following:
o Evaluates the message construct (if there is one) whose name matches the rule’s name (see Messages).
o Evaluates the advice construct (if there is one) whose name matches the rule’s name (see Advice).
o Terminates evaluation of the current module’s rules, and returns false as the module evaluation result.
The conditional expression evaluates to true. In this case, the rule succeeds, and module evaluation continues. If all the rules in a module evaluate to true, module evaluation returns true.
A module’s returned value is used to help determine process and operation routing—see Working with Cost Model Logic for more information on how return values help determine routing.
See the following sections for information on each syntactic category mentioned above: