3 Replies Latest reply on Jan 21, 2013 10:35 AM by yjboss

    JBPM5 database empty

    yjboss

      Hi,

      I use persistence jpa with my JBPM5 application.

      after starting a process, all  work fine but the database is empty , any idea ?

       

      here how i start my process

          

           emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");

                              kbase = readKnowledgeBase();

                              Environment env = KnowledgeBaseFactory.newEnvironment();

                              env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

                              env.set(EnvironmentName.TRANSACTION_MANAGER,TransactionManagerServices.getTransactionManager());

           session = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null,env);

           session.startProcess("com.sample.bpmn.hello");

       

      and my persitence.xml in PJ.

       

      Thanks for your helps

        • 1. Re: JBPM5 database empty
          roxy1987

          y lab,

           

          what do you mean by db emtpy.. no data? or no tables?

          • 2. Re: JBPM5 database empty
            doboss

            JBPM will not actually persist anything if the process runs and completes. (There is no state to save.) However, if you turn on history logging, you will see some data in some of those tables. Or, if your process does not finish (gets to a save/wait state) you will see some state in the DB.

             

            Here is a way to log history:

             

            JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(session);

             

            HTH

            • 3. Re: JBPM5 database empty
              yjboss

              Thanks four your reply ;

              Then if my process dont  have  a way state i dont need perssistence !!!!!!!!!!

              i have learn that i must use perssitence in jbpm5.