[jboss-user] [jBPM] - Problem in a process with a event-based timer and JPAWorkingMemoryDbLogger

Marco Piraccini do-not-reply at jboss.com
Tue Aug 16 10:35:17 EDT 2011


Marco Piraccini [http://community.jboss.org/people/mpiraccini] created the discussion

"Problem in a process with a event-based timer and JPAWorkingMemoryDbLogger"

To view the discussion, visit: http://community.jboss.org/message/621274#621274

--------------------------------------------------------------
Hi Guys, 

I have a very simple process with a timer event:

 http://community.jboss.org/servlet/JiveServlet/showImage/2-621274-16871/process-with-timer-event.jpeg  http://community.jboss.org/servlet/JiveServlet/downloadImage/2-621274-16871/450-170/process-with-timer-event.jpeg 
The timer has a timeCylce of 500ms. The scripts simply set a variable (message1 and message2) that i look to see of the scripts has been executed. 
My test see that -after the prcess start- the first task is executed, waits for 1000ms and then check the that the second task has been executed (inspecting the message2 variable). Also the test check that the process is completed. 
The Task2 script task containt that code:

<bpmn2:script>
System.out.println("Executing Script Task 1");
kcontext.setVariable("message","Executed Script Task 1");
</bpmn2:script>



That works perfectly...at least until I add:

 JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(session);


When I do that, it seems that:
- The timer does not trigger the "Script Task 2" task. 
- The error below appears in the console:

Hibernate: insert into NodeInstanceLog (id, log_date, nodeId, nodeInstanceId, nodeName, processId, processInstanceId, type) values (null, ?, ?, ?, ?, ?, ?, ?)
INFO  BitronixTransactionManager - shutting down Bitronix Transaction Manager
org.drools.RuntimeDroolsException: Unexpected exception executing action org.jbpm.process.instance.event.DefaultSignalManager$SignalProcessInstanceAction at 22862041
    at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:996)
    at org.drools.impl.StatefulKnowledgeSessionImpl.executeQueuedActions(StatefulKnowledgeSessionImpl.java:845)
    at org.jbpm.process.instance.event.DefaultSignalManager.signalEvent(DefaultSignalManager.java:89)
    at org.jbpm.process.instance.timer.TimerManager$ProcessJob.execute(TimerManager.java:164)
    at org.drools.time.impl.JDKTimerService$JDKCallableJob.call(JDKTimerService.java:151)
    at org.drools.persistence.jpa.JpaJDKTimerService$JpaJDKCallableJob.internalCall(JpaJDKTimerService.java:80)
    at org.drools.persistence.jpa.JpaJDKTimerService$JpaJDKCallableJob.access$100(JpaJDKTimerService.java:63)
    at org.drools.persistence.jpa.JpaJDKTimerService$JDKCallableJobCommand.execute(JpaJDKTimerService.java:96)
    at org.drools.persistence.jpa.JpaJDKTimerService$JDKCallableJobCommand.execute(JpaJDKTimerService.java:84)
    at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:292)
    at org.drools.persistence.jpa.JpaJDKTimerService$JpaJDKCallableJob.call(JpaJDKTimerService.java:75)
    at org.drools.persistence.jpa.JpaJDKTimerService$JpaJDKCallableJob.call(JpaJDKTimerService.java:63)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
    at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67)
    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:180)
    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getNodeContainer(WorkflowProcessInstanceImpl.java:68)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNode(NodeInstanceImpl.java:100)
    at org.jbpm.workflow.instance.node.ActionNodeInstance.getActionNode(ActionNodeInstance.java:35)
    at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:43)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:122)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:185)
    at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:150)
    at org.jbpm.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerCompleted(ExtendedNodeInstanceImpl.java:47)
    at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:162)
    at org.jbpm.workflow.instance.node.TimerNodeInstance.triggerCompleted(TimerNodeInstance.java:135)
    at org.jbpm.workflow.instance.node.TimerNodeInstance.signalEvent(TimerNodeInstance.java:125)
    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:333)
    at org.jbpm.process.instance.event.DefaultSignalManager$SignalProcessInstanceAction.execute(DefaultSignalManager.java:117)
    at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:994)
    ... 18 more


...any idea? It seems a bug to me...
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/621274#621274]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110816/df51d5ca/attachment.html 


More information about the jboss-user mailing list