NullPointerException is thrown when event with a timestamp set in the past is modified

Solution Verified - Updated -

Issue

A NPE is thrown when an event with a timestamp set in the past (before pseudo clock) is modified in RHS, and the LHS of the rule reason over event with an 'after' operator.

Following line:

((KieSession) kieRuntime).fireAllRules();

is raising this NPE:

org.jbpm.workflow.instance.WorkflowRuntimeException: [Sample:1 - ruleflow-group1:2] -- null
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:161)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:337)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:296)
    at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:66)
    at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:43)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:155)
    at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:35)
    at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:226)
    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:362)
    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcessInstance(ProcessRuntimeImpl.java:194)
    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:176)
    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:168)
    at org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:163)
    at org.drools.core.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1570)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:361)
    at org.test.TimeOperatorTest.main(TimeOperatorTest.java:54)
Caused by: java.lang.NullPointerException
    at org.drools.core.time.impl.PseudoClockScheduler.removeJob(PseudoClockScheduler.java:151)
    at org.drools.core.phreak.PhreakTimerNode.doLeftUpdates(PhreakTimerNode.java:124)
    at org.drools.core.phreak.PhreakTimerNode.doNode(PhreakTimerNode.java:65)
    at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:357)
    at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161)
    at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116)
    at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:195)
    at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:68)
    at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:935)
    at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1200)
    at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:952)
    at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:926)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:256)
    at org.test.TimeOperatorTest$1.afterRuleFlowGroupActivated(TimeOperatorTest.java:39)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl$AgendaEventListenerWrapper.afterRuleFlowGroupActivated(StatefulKnowledgeSessionImpl.java:717)
    at org.drools.core.event.AgendaEventSupport.fireAfterRuleFlowGroupActivated(AgendaEventSupport.java:137)
    at org.drools.core.common.DefaultAgenda.activateRuleFlowGroup(DefaultAgenda.java:677)
    at org.drools.core.common.DefaultAgenda.activateRuleFlowGroup(DefaultAgenda.java:665)
    at org.drools.core.runtime.rule.impl.AgendaImpl.activateRuleFlowGroup(AgendaImpl.java:74)
    at org.jbpm.workflow.instance.node.RuleSetNodeInstance.internalTrigger(RuleSetNodeInstance.java:79)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:155)
    ... 15 more

Environment

  • Red Hat JBoss BRMS
    • 6.0.0
    • 6.0.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In