JBoss Community

How to detect crashed process instance in jbpm 4.1 ?

created by Elisabeth Müller in jBPM - View the full discussion

We are using JBPM 4.1 and need to implement some kind of recovery logic to cope with the problem of crashed process instances.

The application is a server application resposible to execute various workflows. We are using the persistence layer which assures that process states are saved to the database.

In case the application crashes, e.g. because of a hardware failure we need to restart the application and resume the various activities which have been in progress when the application crashed.

Since there is no automatism available, a process instance of a workflow  will recover in its last saved state and will not continue until I trigger an appropriate transistion.

So far so good. My problem is no the following:

 

I need to find the crashed activities of process instances.

 

My current idea is:

  • check all process instances which are not suspended or ended
  • check whether type of last activity is state or task
  • if this is not the case check whether activity is currently locked by another jbpm instance

 

 

But how to do this. Will the method "isActive" work also in case the activity was locked before by the jbpm instance which crashed ? How is the optimistic locking implemented ? Does this work similar to "selectForUpdate" in the database and disappears when the instance has crashed ?

 

 

Hopefully anyone can help,

Elisabeth

Reply to this message by going to Community

Start a new discussion in jBPM at Community