[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()
   {
      try
      {
         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
[https://community.jboss.org/message/787148#787148]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- 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