-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
None
-
None
-
None
-
2017 Week 36-37
-
-
NEW
-
NEW
We are trying to migrate project on newest version of drools, but had regression testing failure. We have extracted simplest scenario to reproduce it.
package demo import demo.DataRow; import demo.ExpectedError; import demo.Dark; rule "rule-1" salience 130 no-loop true when $a: DataRow(viewId == Dark.Xantor.$ID, $d: row[Dark.Xantor.wand] != null) $b: DataRow(viewId == Dark.Aragorn.$ID, row[Dark.Aragorn.sword] == $d) $c: DataRow(viewId == Dark.Tant.$ID, row[Dark.Tant.crown] == $d) then $a.setField(Dark.Xantor.sword, $c.getField(Dark.Tant.sword)); $a.setField(Dark.Xantor.chainmail, $c.getField(Dark.Tant.tower)); update($a); end rule "rule-2" salience 110 no-loop true when $a: DataRow(viewId == Dark.Xantor.$ID, $b: row[Dark.Xantor.wand] != null, row[Dark.Xantor.sword] == "claymore", row[Dark.Xantor.bow] == null) then throw new ExpectedError(); end
initial facts:
Dark.Tant( crown: 123, sword: claymore ) Dark.Aragorn( sword: 123 ) Dark.Xantor( wand: 123 )
Expected to catch ExpectedError (rule-2 to be fired), but nothing happens.
Detailed exploit attached as Maven project with two executable modules. Main650 class demonstrates positive scenario (it run rules with 6.5.0.Final), Main720 (runs the same rules with 7.2.0.Final) - negative. "Main" class contains basic scenario without link to drools version