uvijayreddy657 [
http://community.jboss.org/people/uvijayreddy657] created the discussion
"Re: SessionInfo and ProcessInstanceInfo tables are not getting updated when starting
the process using JPAKnoweldgeService"
To view the discussion, visit:
http://community.jboss.org/message/627684#627684
--------------------------------------------------------------
Now I am creating 2 EntityManagerFactories as per the suggestion each for MinaTaskServer
and Task related things. Though JPAKnowledgeService is not persisting SessionInfo and
ProcessInstanceInfo.
1) MinaTaskServer:
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("org.jbpm.task");
TaskService taskService = new
TaskService(emf,SystemEventListenerFactory.getSystemEventListener());
TaskServiceSession taskSession = taskService.createSession();
if (taskServer == null || !taskServer.isRunning()) {
taskServer = new MinaTaskServer(taskService);
Thread thread = new Thread(taskServer);
thread.start();
}
2) for Others
emf = Persistence.createEntityManagerFactory("WFJPAPersistenceUnit");
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);
ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase,config, env);
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/627684#627684]
Start a new discussion in jBPM Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]