1 2 Previous Next 17 Replies Latest reply on Jan 11, 2006 7:40 AM by ralfoeldi Go to original post
      • 15. Re: EAR-based ProcessDefinition deployment
        ralfoeldi

        Hi Johan,

        sorry. Maybe I misunderstood you.

        I thought you were suggesting to keep track of the automatically set version numbers of the ProcessDefinitions - ProcessDefiniton.getVersion(). That would lead to all kinds of problems as I have no way of knowing whats in the prod env.

        Manually keeping track of version - be it in a seperate file in the *.par or as a 'dummy node' - i.e. ignoring the ProcessDefinition.getVersion() info at least for the purpose of figuring out if we have to deploy, isn't nice but at least safe.

        Are we talking about the same things?

        Rainer

        • 16. Re: EAR-based ProcessDefinition deployment

          Now we are. I see no other way but for you to use that version number. You can set it in code when you load the process definition.
          ...
          JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession(conn);
          try {
          // ... and begin a transaction on the persistence session
          jbpmSession.beginTransaction();
          ProcessDefinition definition =
          ProcessDefinition.parseXmlResource(processName+".par/processdefinition.xml");
          definition.setVersion(version);
          // Save the process definition in the database
          jbpmSession.getGraphSession().saveProcessDefinition(definition);
          // Commit the transaction
          jbpmSession.commitTransaction();
          }
          finally {
          // And close the jbpmSession.
          jbpmSession.close();
          }
          ...
          I believe the version number remains undefined unless you set it - except when you use a par file. So, yes, you need to keep track of the version numbers in production. Hey, its never easy.

          • 17. Re: EAR-based ProcessDefinition deployment
            ralfoeldi

            Hi Johan,

            I guess you're right. One could store the version in the *.par, check if a version with that number already exists and depending on the result deploy or not.

            That should do the trick. I guess I was mixing up hibernate id and version.

            Thanks

            Rainer

            1 2 Previous Next