-
1. Re: JBPM5 running processess/tasks behaviour when App Server shutdown/restart
booveman May 25, 2011 10:21 AM (in response to anandintouch)Hi Anand,
WRT 1) are you refering to a longer running task on your created process/flow that is interrupted due to a server outtake? in that case you can use the jbpm-console to trigger a continuation or restart of that process. outherwise you should be abe to access the next human task through the console just fine. If neither of these cases please elaborate what you are refering to.
WRT 2) I don't understand. We have set the hibernate.hbm2ddl.auto property to "update" and just continue to use the sequence created on the first run - seems to be a DB issue - what DB are you on? If you use just one session (1) you should be just fine and may reuse the session on the restart.
-
2. Re: JBPM5 running processess/tasks behaviour when App Server shutdown/restart
anandintouch Jun 7, 2011 11:39 AM (in response to booveman)Hi Brkhard,
Thanks for your response. I'm not using jbpm console ,I've integrated jbpm with my application and from there I start processes/task.
Yes I was talking about long running task meaning process/task which is started but not finished and if we restart server
then will it pick trigger again with same old session in sessioninfo table with that id=1 ? Mostly it works but sometime it doesn't complete the tasks after server restart may be because of old session is not used which had triggered those process/tasks.
So new session gets created and that works fine to start new process/task.
I'm using Oracle DB and on server(Tomcat) restart I test if JBPM sequence and tables is available then don't create new otherwise create new sequence/tables.
Basically I need help related to session handling, I've notice some weird exception.Sometime after server restart I see "java.lang.NullPointerException" because ksession is null and hence while calling below line in CommandDelegate, application throw this exception.
ksession.startProcess(processId, parameters).getId();
While server start,app looks for sessioninfo table for default id "1" otherwise commanddelgate class creates new session but
sometime I see below exception(error laoding session snapshot) and it never create or use old session to trigger old or new process/tasks.
Loading process AutoCyclicalRiskAssesment.bpmn
Loading session data ...
Error loading session data: java.lang.reflect.InvocationTargetException
Error loading session data: java.lang.RuntimeException: Unable to load session snapshot
12:35:26,907 ERROR [CommandDelegate] java.lang.IllegalStateException: java.lang.reflect.InvocationTar
getException
This exception may be because "cause" is null throw exception but not sure why/how to tackle this session issue.
So any help to handle session properly would be greatly appreciated .I need to know how to properly handle while server runs or if any server restart/shutdown/maintenance.
Thanks,
Anand
-
3. Re: JBPM5 running processess/tasks behaviour when App Server shutdown/restart
melc Jun 7, 2011 6:38 PM (in response to anandintouch)Hello,
Well i've noticed that when running a custom work item that takes long and the system goes down, then when the system restarts the tasks are not resumed thus not finished.
What i do is since the custom work items are actually persisted in the database by the jbpm, when the system goes down before they've completed i've put some extra code to restart the work items present in the database as bootstrap code on the initialization of the system i.e.
for (Object resultObject : results) {
//where results are the rows from selecting the workitems from the database having name equal to my custom work items
WorkItemInfo workItemInfo = (WorkItemInfo) resultObject;
WorkItem workItem = workItemInfo.getWorkItem(ksession.getEnvironment());
MyCustomWorkItemHandler myCustomWorkItemHandler = new MyCustomWorkItemHandler ();
myCustomWorkItemHandler .executeWorkItem(workItem, ksession.getWorkItemManager());
}