Using the disjuntive conditional element (OR).
It causes some confusion for people to realise that the OR conditional element, when used in a rule LHS, does NOT short circuit like in most programming languages.
The reason for this is clearer when you realise that when you use an "or" then engine will effectively generate seperate rules for either side of the condition. This means that the consequence may take effect for both parts sides of the OR.
This is actually a feature: the benefit of this is that you can use the firing of both consequences as a way of building up evidence of why an action was taken. If both sides of the OR element are true, then there are 2 reasons why that consequence applies (and if the consequence has side effects, there are many other ways of preventing it from firing multiple times).
Some people prefer to keep rules "atomic": this means avoiding the OR conditional element, and instead writing two explicit rules to cover both cases (there is no efficiency penalty for doing it like this).
Comments