JBoss Community

Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting the process using JPAKnoweldgeService

created by uvijayreddy657 in jBPM Development - View the full discussion

Mauricio,

 

I am including ProcessInstanceInfo, SessionInfo and WorkItemInfo in persistence.xml. I am attaching my persistence.xml here. If any modifications required please suggest me.

 

I am using JPAKnowledgeService only to create session. This is the code which I am using:

  

Properties properties = new Properties();

properties.put("drools.processInstanceManagerFactory","org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");

properties.put("drools.processSignalManagerFactory"

,

"org.jbpm.persistence.processinstance.JPASignalManagerFactory");

 

KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);

 

kbase = kbuilder.newKnowledgeBase();

 

 

 

 

 

 

 

 

Environment env = KnowledgeBaseFactory.newEnvironment();

env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf

);

env.set(EnvironmentName.GLOBALS, new

MapGlobalResolver());

env.set(EnvironmentName.APP_SCOPED_ENTITY_MANAGER,emf.createEntityManager());

 

 

userTransaction = TransactionManagerServices.getTransactionManager();

env.set(EnvironmentName.TRANSACTION_MANAGER, userTransaction

);

 

env.set(EnvironmentName.TRANSACTION, userTransaction,userTransaction);



StatefulKnowledgeSession  ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);

 



Reply to this message by going to Community

Start a new discussion in jBPM Development at Community