-
Bug
-
Resolution: Done
-
Critical
-
8.26.0.Final
-
None
-
2022 Week 35-37 (from Aug 29)
-
3
-
- clone this repo: https://github.com/ewinchen/op-incorrect-match
- run ./mvnw spring-boot:run
-
NEW
-
NEW
I have 4 rules in drl file, as below
rule "All planned" when Task(produceType == 2) then scoreHolder.addMediumConstraintMatch(kcontext, -10); end rule "If not planned, Dark fisrt" when Task(produceType == 2, artColorDegree == "Dark") then scoreHolder.addSoftConstraintMatch(kcontext, -10); end rule "If not planned, Light second" when Task(produceType == 2, artColorDegree == "Light") then scoreHolder.addSoftConstraintMatch(kcontext, -20); end rule "If not planned, White third" when Task(produceType == 2, artColorDegree == "White") then scoreHolder.addSoftConstraintMatch(kcontext, -30); end
However, Task(produceType == 1) will match 1 of the 3 "If not planned *" rules.
Constraint match totals: -30soft: constraint (If not planned, White third) has 1 matches: -30soft: justifications ([Task{id=3, produceType=1, planDateId=8, machineGroupId=6}]) -20soft: constraint (If not planned, Light second) has 1 matches: -20soft: justifications ([Task{id=2, produceType=1, planDateId=8, machineGroupId=7}]) -10soft: constraint (If not planned, Dark fisrt) has 1 matches: -10soft: justifications ([Task{id=1, produceType=1, planDateId=2, machineGroupId=2}])
Comment 1 of the 3 "If not planned *" rules, it will work correctly or
change comma(,) to &&, it will work correctly.
rule "If not planned, Dark fisrt" when Task(produceType == 2 && artColorDegree == "Dark") then scoreHolder.addSoftConstraintMatch(kcontext, -10); end rule "If not planned, Light second" when Task(produceType == 2 && artColorDegree == "Light") then scoreHolder.addSoftConstraintMatch(kcontext, -20); end rule "If not planned, White third" when Task(produceType == 2 && artColorDegree == "White") then scoreHolder.addSoftConstraintMatch(kcontext, -30); end
This is very unexpected, could anyone help to solve this, thanks.
- is caused by
-
DROOLS-7137 alphanetwork-compiler : failed to evaluate chained alpha node
- Resolved