JBoss Community

Re: JBPM5 running processess/tasks behaviour when App Server shutdown/restart

created by Chris Melas in jBPM - View the full discussion

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());

            }

Reply to this message by going to Community

Start a new discussion in jBPM at Community