I have a rule that uses or() in a when clause like this:
rule d42 {
when {
or(
v1 : Value v1.id =~ /f39/, v2 : Value v2.id =~ /f117/ );
r : Result;
} then {
r.push("r42");
}
}
If I assert two Value instances with ids 'f39' and 'f117', the rule ends up firing twice.
I can sort of see why the rule would fire twice. But, in keeping with inclusive-or semantics, I think it's equally valid to expect it to fire once -- at least that's what I expected while I was typing it in.
Being a newbie to rules-based programming, is there some subtle rules/logic thing that I'm missing here? Is there a way to get the above rule to fire just once when both facts are asserted?