[jboss-user] [jBPM] - How to restart process, when process terminated on timer JBPM 5.3

Ashish Sinha do-not-reply at jboss.com
Wed Jul 4 09:25:28 EDT 2012

Ashish Sinha [https://community.jboss.org/people/imtuku] created the discussion

"How to restart process, when process terminated on timer JBPM 5.3"

To view the discussion, visit: https://community.jboss.org/message/746085#746085

I am trying to restore process from server crash. 
If process hasn't reached to timer event, process is realoaded from old session and continue process calling myWorkItemHandler.completeWorkItem(workItem, manager). 

1. Load Old session - stored in file on server startup

kSession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kSession.getKnowledgeBase(),kSession.getSessionConfiguration(), kSession.getEnvironment());myWorkItemHandler.completeWorkItem(workItem, manager)

2. Get the work Item from WorkItem table.
  "SELECT o FROM WorkItemInfo AS o WHERE o.processInstanceId = :processId"

3. Once recived workItem, from step 2. call
myWorkItemHandler.completeWorkItem(workItem, manager)

It works fine if the process was terminated at non timer node.

But if the process reaches at timer event, there is no way to follow the same approach as info gets deleted from *WorkItemInfo table. (*It's okie*)*

KSession has singalEvent() method, which indicate I can use to complete or restore timer event, but couldn't get success. 

|| *Singal Even : Timer node with ProcessInstanceInfo object* ||
| // Load failed session
kSession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kSession.getKnowledgeBase(),
                    kSession.getSessionConfiguration(), kSession.getEnvironment());

String type = "TimerEvent"; // or "Timer" as per xml represenation of myProcess.bpmn file

long processInstanceId = 17L;
Object event = getProcessInstanceInfo(processInstanceId);

// Signal timer event,
kSession.signalEvent(type, event, processInstanceId); |

Any idea how to signal this event and what parameter is needed.


Reply to this message by going to Community

Start a new discussion in jBPM at Community

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

More information about the jboss-user mailing list