[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2072) Updating a fact within a rule fails unless the fact is explicitly declared in the LHS of the rule

Damon Horrell (JIRA) jira-events at lists.jboss.org
Thu Apr 23 01:10:40 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBRULES-2072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12463995#action_12463995 ] 

Damon Horrell commented on JBRULES-2072:
----------------------------------------

The exception thrown is:


org.drools.runtime.rule.ConsequenceException: org.drools.FactException: Update error: handle not found for object: jira2072.Foo at 1f1bd98. Is it in the working memory?
	at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
	at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
	at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
	at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1082)
	at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:682)
	at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:649)
	at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
	at jira2072.RulesTest.doIt(RulesTest.java:49)
	at jira2072.RulesTest.testWithoutExplicitDeclaration(RulesTest.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
	at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
	at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
	at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
	at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
	at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
	at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
	at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
	at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
	at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.drools.FactException: Update error: handle not found for object: jira2072.Foo at 1f1bd98. Is it in the working memory?
	at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:152)
	at jira2072.Rule_not_declaring_foo_in_LHS_0.consequence(Rule_not_declaring_foo_in_LHS_0.java:7)
	at jira2072.Rule_not_declaring_foo_in_LHS_0ConsequenceInvoker.evaluate(Rule_not_declaring_foo_in_LHS_0ConsequenceInvoker.java:23)
	at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
	... 27 more



> Updating a fact within a rule fails unless the fact is explicitly declared in the LHS of the rule
> -------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-2072
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2072
>             Project: JBoss Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: Damon Horrell
>            Assignee: Mark Proctor
>         Attachments: drools-bug-tests.zip
>
>
> This works:
> rule "declaring foo in LHS"
> 	when
> 		bar : Bar(foo : foo);
> 	then
> 		update(foo);
> end
> but this doesn't:
> rule "not declaring foo in LHS"
> 	when
> 		bar : Bar();
> 	then
> 		update(bar.getFoo());
> end
> This was broken recently because it works in 5.0.0.CR1 but not in 5.0.0.SNAPSHOT or 5.0.1.SNAPSHOT.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list