-
Bug
-
Resolution: Done
-
Major
-
None
-
7.32.0.Final, 7.33.0.Final, 7.34.0.Final, 7.35.0.Final, 7.36.0.Final, 7.37.0.Final, 7.38.0.Final, 7.39.0.Final, 7.40.0.Final, 7.41.0.Final, 7.42.0.Final, 7.43.0.Final
-
None
-
2020 Week 40-42 (from Sep 28)
-
-
Undefined
-
NEW
-
NEW
-
---
-
---
As of Drools 7.32.0.Final, forall patterns with "empty list" constraints combined with other constraints through || will fail to match as expected.
For example the following rule:
rule "forall with not equal" when forall($p : Pojo(y == 1) Pojo(x.empty || x contains 2, z == 3, this == $p)) then end
will not fire against following facts:
Pojo{x=[2], y=0, z=0} Pojo{x=[], y=1, z=3} Pojo{x=[3], y=0, z=3} Pojo{x=[2], y=1, z=3}
We suspect a problem with the rewriting of the forall clause. It appears the clause is rewritten as:
not Pojo(y == 1, (x.empty && !(x contains 2)) || !(z == 3))
instead of the expected:
not Pojo(y == 1, (!(x.empty) && !(x contains 2)) || !(z == 3))
This is working fine when using Drools <= 7.31.0.Final.