JBoss Community

Re: jBPM 5: how save a ProcessInstance ?

created by Andy R. in jBPM - View the full discussion

 

 

The fact that the processInstance is automatically saved may be convenient. But doing some investigation on the jbpm5-source I found some interesting code examples that may offer explicit saving of a ProcessInstance:

 

EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa");

JpaProcessPersistenceContextManager procPersistMgr = new JpaProcessPersistenceContextManager(env);

ProcessInstanceInfo procInfo = new

ProcessInstanceInfo(procInstance);

 

ProcessPersistenceContext persistContext = procPersistMgr.getProcessPersistenceContext();

persistContext.persist(procInfo);

 

The "ProcessPersistenceContext" allows to persist a so-called ProcessInstanceInfo-object. This object contains a ProcessInstance-object. Are you consequently sure that there is no way to persist  ProcessInstance on-demand ?

 

 

 

 



#

Reply to this message by going to Community

Start a new discussion in jBPM at Community