Details
-
Bug
-
Resolution: Done
-
Minor
-
5.5.0.Final
-
None
-
None
Description
Consider this rule:
<code>
rule "Hitpoints.Lethal.Dead"
when
Stat(name == StatInput.CON, $con:value)
CurrentHitpoints(type == "Lethal", value <= -$con)
then
insertLogical(new Condition(ConditionInput.TYPE_DEAD));
end
</code>
This emits the following exception:
<code>
Exception in thread "Thread-2" java.lang.RuntimeException: Null accessor on node: $con
at org.drools.rule.constraint.ConditionAnalyzer.analyzeNode(ConditionAnalyzer.java:247)
at org.drools.rule.constraint.ConditionAnalyzer.analyzeSingleCondition(ConditionAnalyzer.java:108)
at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:99)
at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:70)
at org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:83)
at org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:270)
at org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:51)
at org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:250)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
</code>
If I change the comparison to "value <= (0-$con)" then it works as expected.