JBoss Community

Re: What is the right way to work with persistent sessions and processes?

created by Mauricio Salatino in jBPM - View the full discussion

Hi Miljenko,

Drools and jBPM5 persistence mechanisism let you choose for your particular situation the way of distributing and creating your sessions for your processes. There is not right way to do it. You can create as you mention a session per group of related processes and rules and then start process instances there. You should try to keep your rules well scoped to your processes and for example add your process instance as a Fact so you can filter facts based on the process instance that you are intested into.

 

About the custom persistence strategies, yes of course! You can use a set of custom marshallers that will persist your Domain objects in a different database or storage using your own entity manager. -> https://github.com/droolsjbpm/jbpm/blob/master/jbpm-persistence-jpa/src/test/java/org/jbpm/persistence/session/VariablePersistenceStrategyTest.java

Look at the method createEnvironment() for more references :)

Hope it helps!

Cheers

Reply to this message by going to Community

Start a new discussion in jBPM at Community