[jboss-jira] [JBoss JIRA] Closed: (JBRULES-907) When globals are used in a lhs of a rule, you cannot create a new working memory
Mark Proctor (JIRA)
jira-events at lists.jboss.org
Mon Jun 11 21:38:18 EDT 2007
[ http://jira.jboss.com/jira/browse/JBRULES-907?page=all ]
Mark Proctor closed JBRULES-907.
--------------------------------
Resolution: Won't Fix
fixed in 4.0
> When globals are used in a lhs of a rule, you cannot create a new working memory
> --------------------------------------------------------------------------------
>
> Key: JBRULES-907
> URL: http://jira.jboss.com/jira/browse/JBRULES-907
> Project: JBoss Rules
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 3.0.6
> Environment: JDK 1.5.0 under Windows XP
> Reporter: Krishnan Sivaramakrishna Iyer
> Assigned To: Mark Proctor
> Priority: Blocker
> Fix For: 3.0.6
>
>
> Rule file
> #created on: May 16, 2007
> package com.sample
> #list any import classes here.
> import com.sample.Line;
> #declare any global variables here
> global Line newLine;
> rule "Generate new object line"
> when
> eval (newLine.getLine().equals(""))
> then
> System.out.println("This is an empty line.");
> end
> /**
> *
> */
> package com.sample;
> import java.lang.String;
> /**
> * @author kiyer
> *
> */
> public class Line {
> private String line;
>
> public Line(String line) {
> setLine(line);
> }
> /**
> * @return the line
> */
> public String getLine() {
> return line;
> }
> /**
> * @param line the line to set
> */
> public void setLine(String line) {
> this.line = line;
> }
>
> }
> In the main program, call the following
> final RuleBase ruleBase = readRule();
> final WorkingMemory session = ruleBase.newWorkingMemory();
> You will see the following exception
> org.drools.RuntimeDroolsException: java.lang.NullPointerException
> at org.drools.rule.EvalCondition.isAllowed(Unknown Source)
> at org.drools.reteoo.EvalConditionNode.assertTuple(Unknown Source)
> at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple(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.ReteooRuleBase.newWorkingMemory(Unknown Source)
> at org.drools.common.AbstractRuleBase.newWorkingMemory(Unknown Source)
> at com.sample.CfiTest.main(CfiTest.java:24)
> Caused by: java.lang.NullPointerException
> at com.sample.Rule_Generate_new_object_line_0.eval0(Rule_Generate_new_object_line_0.java:10)
> at com.sample.Rule_Generate_new_object_line_0Eval0Invoker.evaluate(Rule_Generate_new_object_line_0Eval0Invoker.java:18)
> ... 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
More information about the jboss-jira
mailing list