JBPM6: How to resume a process from the last successful node after a server failure?

I am trying to implement a strategy for switching to another resource while executing jbpm6 processes. My setup is this:

  • I am using jbpm6.2.0-Final (latest stable version) with support enabled.
  • I create an instance of org.kie.spring.factorybeans.RuntimeManagerFactoryBean with type SINGLETON to get KSession to start / stop processes and terminate / abort work items
  • all beans are connected to Spring 3.2
  • DB2 uses a database engine
  • I am using Tomcat 7.0.27

In a positive scenario, everything works as I expect. But I would like to know how to resume the process in case of server failure. To reproduce it, I started my process (described as a BPMN2 file), got to some middle step and killed the Tomcat process. After that, I see an incomplete process instance in the PROCESS_INSTANCE_INFO table and an incomplete work item in the WORK_ITEM_INFO table. There is also a session in the SESSION_INFO table.

My question is: could you show me an example of code that will take this remaining process and resume it starting from the last node (if possible).

Update I forgot to mention that I do not use the jbpm console, but I embed jbpm in my javaee application.

+6
source share
1 answer

If you initialize your RuntimeManager when the application server starts, it should take care to restart and resume processes. You do not need to worry about restarting it again.

+1
source

Source: https://habr.com/ru/post/984566/


All Articles