3 Replies Latest reply on Aug 8, 2008 7:34 AM by kukeltje

    Deployment of Process Definition

    ragna

      Hi there,

      I wrote my first process definition which only consists of three nodes. I can deploy it over the web console and execute it from console and code without problem.
      Now I want to deploy the process definition programmatically, and I get the following error:

      14:57:43,683 ERROR [DbPersistenceService] hibernate commit failed
      org.hibernate.PropertyAccessException: could not get a field value by reflection getter of org.jbpm.graph.def.ProcessDefinition.events
       at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:35)
       at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValue(AbstractEntityTuplizer.java:277)
       at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValue(AbstractEntityPersister.java:3581)
       at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
       at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
       at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
       at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:260)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:218)
       at org.jbpm.svc.Services.close(Services.java:223)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      .......
      


      I tried to load a process definition in code and save it, this works fine. But I reconized that the fields events and actions where filled with empty maps. In contrast : the process definition which i read from file has null values for this fields.

      Is this a hibernate configuration issue? Has someone a hint?

      Here is the code i use:
      JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
      try {
       ProcessDefinition emailProcess = ProcessDefinition.parseXmlResource("doorprocess/processdefinition.xml");
       jbpmContext.deployProcessDefinition(emailProcess);
      } finally {
       jbpmContext.close();
      }


      Thanks for any help!

        • 1. Re: Deployment of Process Definition
          kukeltje

          do not forget to also save the processdefinition

          • 2. Re: Deployment of Process Definition
            ragna

            Thanks for the reply!

            I also tried

            JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
            try {
             ProcessDefinition emailProcess = ProcessDefinition.parseXmlResource("doorprocess/processdefinition.xml");
            // jbpmContext.deployProcessDefinition(emailProcess);
             jbpmContext.getGraphSession().saveProcessDefinition(emailProcess);
            } finally {
             jbpmContext.close();
            }
            


            with the deploy line commented in and out, with always the same result. I also tried first making an archive and read this with no more success.

            Is there another way to save the process definition?

            • 3. Re: Deployment of Process Definition
              kukeltje

              this should work.. it is the same way that the console does it. So please make a unit test that demonstrates the problem