[jboss-jira] [JBoss JIRA] (DROOLS-177) Unary negation of a variable doesn't work right in an expression
Mario Fusco (JIRA)
jira-events at lists.jboss.org
Thu Jul 11 13:14:21 EDT 2013
[ https://issues.jboss.org/browse/DROOLS-177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco resolved DROOLS-177.
--------------------------------
Fix Version/s: 6.0.0.CR1
Resolution: Done
> Unary negation of a variable doesn't work right in an expression
> ----------------------------------------------------------------
>
> Key: DROOLS-177
> URL: https://issues.jboss.org/browse/DROOLS-177
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 5.5.0.Final
> Reporter: Chris Dolan
> Assignee: Mario Fusco
> Priority: Minor
> Fix For: 6.0.0.CR1
>
>
> 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list