3 Replies Latest reply on Jan 8, 2014 4:00 AM by Maciej Swiderski

    Error executing timer job when reusable subprocess is executing

    Galen Hollins Newbie

      Hi,

       

         I have a process where there is a parallel gateway, and on one of the paths, there is a "duration" timer.  If the timer happens to fire while the "call activitiy" (the one at the bottom of the picture) is running, I get an error:

       

      10:55:17,472 ERROR [org.jbpm.process.instance.timer.TimerManager] (pool-26-thread-1) Error when executing timer job: org.drools.core.RuntimeDroolsException: Unexpected exception executing action org.jbpm.process.instance.event.DefaultSignalManager$SignalProcessInstanceAction@392bfc

        at org.drools.core.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1247) [drools-core-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.core.impl.StatefulKnowledgeSessionImpl.executeQueuedActions(StatefulKnowledgeSessionImpl.java:892) [drools-core-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.process.instance.event.DefaultSignalManager.signalEvent(DefaultSignalManager.java:90) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.process.instance.timer.TimerManager$ProcessJob.execute(TimerManager.java:288) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.core.time.SelfRemovalJob.execute(SelfRemovalJob.java:19) [drools-core-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.core.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:54) [drools-core-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.persistence.jpa.JpaTimerJobInstance.internalCall(JpaTimerJobInstance.java:43) [drools-persistence-jpa-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.persistence.jpa.JDKCallableJobCommand.execute(JDKCallableJobCommand.java:20) [drools-persistence-jpa-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.persistence.jpa.JDKCallableJobCommand.execute(JDKCallableJobCommand.java:6) [drools-persistence-jpa-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36) [drools-core-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:532) [drools-persistence-jpa-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) [drools-core-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:71) [drools-persistence-jpa-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:374) [drools-persistence-jpa-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.process.core.timer.impl.GlobalTimerService$DisposableCommandService.execute(GlobalTimerService.java:271) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.persistence.timer.GlobalJpaTimerJobInstance.call(GlobalJpaTimerJobInstance.java:59) [jbpm-persistence-jpa-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.persistence.timer.GlobalJpaTimerJobInstance.call(GlobalJpaTimerJobInstance.java:39) [jbpm-persistence-jpa-6.0.0.Final.jar:6.0.0.Final]

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [classes.jar:1.6.0_65]

        at java.util.concurrent.FutureTask.run(FutureTask.java:138) [classes.jar:1.6.0_65]

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) [classes.jar:1.6.0_65]

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) [classes.jar:1.6.0_65]

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_65]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_65]

        at java.lang.Thread.run(Thread.java:695) [classes.jar:1.6.0_65]

      Caused by: java.lang.RuntimeException: Process instance 107[mortgages.test] is disconnected.

        at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:90) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.process.instance.impl.ProcessInstanceImpl.getContextInstance(ProcessInstanceImpl.java:161) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.WorkflowRuntimeException.initialize(WorkflowRuntimeException.java:56) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.WorkflowRuntimeException.<init>(WorkflowRuntimeException.java:42) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:161) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:337) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:296) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerCompleted(ExtendedNodeInstanceImpl.java:44) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:286) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.node.TimerNodeInstance.triggerCompleted(TimerNodeInstance.java:143) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.node.TimerNodeInstance.signalEvent(TimerNodeInstance.java:133) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:399) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.jbpm.process.instance.event.DefaultSignalManager$SignalProcessInstanceAction.execute(DefaultSignalManager.java:118) [jbpm-flow-6.0.0.Final.jar:6.0.0.Final]

        at org.drools.core.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1245) [drools-core-6.0.0.Final.jar:6.0.0.Final]

        ... 24 more

       

      Screen Shot 2014-01-06 at 11.01.38 AM.png

       

      Is there a way to work around this?  In other words what I really want is that if the timer can still exist in the process, but if it fires during another task, it will either be ignored, or simply wait until the other task is done.  When the above error happens it ends up killing my entire process.

       

      Thanks,

      Galen