[
http://jira.jboss.com/jira/browse/JBRULES-763?page=all ]
Mark Proctor closed JBRULES-763.
--------------------------------
Resolution: Out of Date
Using bindings from the same pattern is a known problem for 3.0.x and won't be fixed
in that branch, it is already fixed in trunk.
http://jira.jboss.com/jira/browse/JBRULES-515
predicate with multiple variable references causes NPE
------------------------------------------------------
Key: JBRULES-763
URL:
http://jira.jboss.com/jira/browse/JBRULES-763
Project: JBoss Rules
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 3.0.6
Environment: Mac OS X 10.4.9 JBoss Rules 3.0.6
Reporter: Steve Miner
Assigned To: Mark Proctor
Attachments: drools-predicate-bug.zip
I'm trying to use a predicate that has multiple references to bound variables all
within the same fact. If I use only one variable, it works, but it causes a NPE if I have
two references.
// This rule causes a NPE
rule "more friends than enemies"
when
$p : Person($enemies : enemies, $friends : friends -> ($friends.size() >
$enemies.size()))
then
System.out.println($p + " has more friends than enemies");
end
stack trace
org.drools.RuntimeDroolsException: java.lang.NullPointerException
at org.drools.rule.PredicateConstraint.isAllowed(Unknown Source)
at org.drools.common.BetaNodeBinder.isAllowed(Unknown Source)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at com.sample.DroolsTest.main(DroolsTest.java:51)
Caused by: java.lang.NullPointerException
at
com.sample.Rule_more_friends_than_enemies_0Predicate0Invoker.evaluate(Rule_more_friends_than_enemies_0Predicate0Invoker.java:13)
... 11 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira