Did it Change?
The subtle issue described in this section is related to a stage in the rule engine algorithm where it detects which rules depend on the changes made by the previously executed action. The subtle point here is that even though the action has been executed it may not have changed the state of the system, even if it had attempted to modify the value of some attribute. This happens, for example, if an action sets the value of the attribute that is equal to its current value. This situation is considered to be a non-event from the rule engine point of view and the rule engine simply ignores the fact that the action has been executed. Consequently it does not re-evaluate the rules and review the existing agenda even for a rule that triggered the last action.
This behaviour helps to avoid infinite loops in certain rules even if they support “while” semantics. Consider the following rule, for example:
IF Policy.Driver.Age > 70 THEN 
    Policy.Excess=200 
If a rule supports the semantics of a “while” statement (see While Semantics) the rule can be interpreted as “while driver’s age is greater than 70 set excess to 200”. The driver’s age will never change here and so we might think that this rule would cause an infinite loop. This does not happen, however. After the action has been executed for the first time and the new value has been set to 200, all subsequent executions of the action would not change the value of the attribute and so the rule is not evaluated again.
note
the rule engine will not execute unconditional rules over and over again if the action keeps changing the value of some attribute, since such action guarantees to cause infinite loop. For example, the following rule with no conditions:INCREASE Policy.Excess BY 100
will only be executed once.