In BRMS 6.4.8, changing the order of "forall" conditional elements combined with "or" causes NullPointerException
Issue
-
The following rule works fine:
rule "Rule" when forall (Fact(tag == "X")) forall(Fact(tag2 == "Y")) ( forall(Fact(value == 42)) or Fact(value == 43) ) then end -
Whereas this one produces a NullPointerException when matching an instance of Fact with {value:42, tag:"X", tag2: "Y"}:
rule "Rule" when forall (Fact(tag == "X")) ( forall(Fact(value == 42)) or Fact(value == 43) ) forall(Fact(tag2 == "Y")) then end -
Note the two rules are functionally equivalent. They only differ with respect to the order of the conditional elements.
Environment
- Red Hat JBoss Business Rules Management System (BRMS) 6.4.8.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
