[jboss-user] [jBPM] - Re: Help using persistence with JBPM 5.4

doboss do-not-reply at jboss.com
Wed Jan 2 15:50:18 EST 2013

doboss [https://community.jboss.org/people/doboss] created the discussion

"Re: Help using persistence with JBPM 5.4"

To view the discussion, visit: https://community.jboss.org/message/787148#787148

Okay, I got it working by changing the code like this:

 @PersistenceUnit(unitName = "org.jbpm.persistence.jpa")
   private EntityManagerFactory emf;

   public void runIt()
         if (kbase == null)
            // load up the knowledge base
            kbase = readKnowledgeBase();
         Environment env = KnowledgeBaseFactory.newEnvironment();
         env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

         // create a new knowledge session that uses JPA to store the runtime
         // state
         StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
         int sessionId = ksession.getId();
         JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);

If anyone wants more details, I would be happy to provide them.

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130102/580cc06c/attachment.html 

More information about the jboss-user mailing list