-
Bug
-
Resolution: Done
-
Minor
-
5.5.0.Final
-
None
-
None
-
-
Workaround Exists
-
In Drools 5.5.0.Final the extends keyword allows one rule (SubRule) to extend another rule (SuperRule). SubRule should only fire if all of the conditions for SubRule and SuperRule are met.
If SubRule is listed after SuperRule after in the .drl file, then it works correctly. However, if SubRule is listed before SuperRule in the .drl file, then only the SubRule's conditions need to be met for the rule to fire.
A temporary workaround is to list all SubRules after the SuperRules.
This might be related to: https://issues.jboss.org/browse/DROOLS-100
To reproduce:
I have a junit test packaged for Maven and Eclipse, but I don't see any place to add the file.
Create 2 .drl files where rule "sub" extends rule "super". Setup a boolean that is true for the sub, but false for the super.
In the first file, place the sub before the super. In the second file, reverse the two.
Observe that the sub fires when it is in the file before the super, but not after. It should not fire either time.