4 Replies Latest reply on Oct 9, 2011 3:17 AM by salaboy21

    Variable Persistence Strategies in jBPM

    harjotnarula09

      I saw the different variable persistence strategies provided by drools in 5.1.1 (http://planet.jboss.org/post/drools_flow_variable_persistence_strategies). I dont find those classes anywhere when I downloaded the jBPM5.0.0 installer which comes with drools-persistence-jpa-5.2.0.M1.jar.

       

      The classes I am looking for are

       

      JPAPersistedVariable.class

      VariableInstanceInfo.class

       

      These used to be bundled in drools-persistence-jpa-5.1.1.jar. Does anyone know if I need some other jar file to get these classes?

      Also if you have an example of working variable persistence, please send me a link to it.

       

      Regards

      Harjot Narula

        • 1. Variable Persistence Strategies in jBPM
          salaboy21

          Hi Harjot,

           

          In 5.2 we merge the current implementation for Variable Persistence with the core marshaling mechanisms of drools.

          You can find a test that show how to configure the new Persisters in the following test inside the jbpm-persistence-jpa project:

           

          https://github.com/droolsjbpm/jbpm/blob/master/jbpm-persistence-jpa/src/test/java/org/jbpm/persistence/session/VariablePersistenceStrategyTest.java

           

          I was responsible for that merge and for the unification of these mechanisms, so please feel free to report any problem that you have with it.

          Greetings.

          • 2. Re: Variable Persistence Strategies in jBPM
            jserdaru

            Hey Mauricio,

             

            I was wondering if there were any changes to the behavior of calling:

            env.set(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER, myCmdScopedEntityManager);

             

            I seem to get the following stack trace when using this (it worked in the previous release)

             

            SEVERE: [http-thread-pool-8080(2)] ERROR essionCommandService - Could not commit session

            java.lang.NullPointerException

                at org.drools.persistence.jpa.JpaPersistenceContext.findWorkItemInfo(JpaPersistenceContext.java:41)

                at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:108)

                at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:69)

                at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:32)

                at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:292)

                at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:149)

            • 3. Re: Variable Persistence Strategies in jBPM
              missedone

              i encounter the same exception, you can try un-register the JPAWorkingMemoryDbLogger but comment the line:

              //new JPAWorkingMemoryDbLogger(ksession);

              • 4. Re: Variable Persistence Strategies in jBPM
                salaboy21

                Hmm that error doens't seem related with the variable persistence strategies.. when are you getting that?

                Cheers