JBoss Community

Re: How to get active processes via ksession.getProcessInstances() (Jbpm 5.1.1)

created by Ryan Peterson in jBPM - View the full discussion

I wound up doing something similar to Amin's solution, where I check the ProcessInstanceInfo table first to see if the session is "alive".  If so I know its still active & working, and if no result is found then it's probable the processInstance is complete.  For anyone else that may have the same issue, I used the JPA query:

 

 

// Query the DB for active processInstances that match the given processId

final Query nativeQuery = entityManagerFactory.createEntityManager().createQuery("SELECT procInfo from ProcessInstanceInfo procInfo where procInfo.processId = :processId");

nativeQuery.setParameter("processId", processId);

Reply to this message by going to Community

Start a new discussion in jBPM at Community