"java.lang.RuntimeException: Update error: handle not found for object: XXX. Is it in the working memory?" is thrown for objects retrieved by "from" clause in BRMS

Solution Verified - Updated -

Issue

  • I get the error when I call "modify" for an Object which is retrieved by "from" clause
org.jbpm.workflow.instance.WorkflowRuntimeException: [DroolsRuleExample.TestRule:1 - Drl rule:2] -- Exception executing consequence for rule "rule1" in example.droolsruleexample: java.lang.RuntimeException: Update error: handle not found for object: example.droolsruleexample.SimpleObject@XXXXXXXX. Is it in the working memory?
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:179)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:366)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:325)
    at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:61)
    at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:57)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:173)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:366)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:325)
    at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:73)
    at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:44)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:173)
    at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)
    at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:236)
    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:449)
    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:206)
    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:190)
    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:182)
    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:177)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:1895)
    at example.droolsruleexample.DroolsTest.testRule(DroolsTest.java:19)
    ...
Caused by: Exception executing consequence for rule "rule1" in example.droolsruleexample: java.lang.RuntimeException: Update error: handle not found for object: example.droolsruleexample.SimpleObject@XXXXXXXX. Is it in the working memory?
    at org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
    at org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1063)
    at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:121)
    at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:74)
    at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:970)
    at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1312)
    at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1364)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1355)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1336)
    at org.jbpm.workflow.instance.node.RuleSetNodeInstance.internalTrigger(RuleSetNodeInstance.java:97)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:173)
    ... 38 more
Caused by: java.lang.RuntimeException: Update error: handle not found for object: example.droolsruleexample.SimpleObject@XXXXXXX. Is it in the working memory?
    at org.drools.core.base.DefaultKnowledgeHelper.getFactHandle(DefaultKnowledgeHelper.java:376)
    at org.drools.core.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:422)
    at org.drools.core.base.ModifyInterceptor.doAfter(ModifyInterceptor.java:87)
    at org.mvel2.ast.InterceptorWrapper.getReducedValueAccelerated(InterceptorWrapper.java:40)
    at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
    at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
    at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
    at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:113)
    at org.mvel2.MVEL.executeExpression(MVEL.java:929)
    at org.drools.core.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:110)
    at org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1052)
    ... 48 more

The rule is like this:

rule "rule1"
ruleflow-group "TestRuleGroup"
lock-on-active true
when
    $CO : ComplexObject()
    $SO : SimpleObject() from $CO.simpleObjects
then
    modify ($SO) {name = "I am simple object from complex"};
end

Environment

  • Red Hat JBoss BRMS
  • Red Hat JBoss BPM Suite
    • 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In