1 Reply Latest reply on Dec 13, 2006 2:23 AM by Matthieu Guyonnet-Duluc

    Deploying process programatically, Hibernate

    jerzy stachera Newbie

      Hi,

      I have question which is related to deployment of process definition from the code, as it is shown below. Actually it is more hibernate issue, since every new deployed Process Definition is not getting a consecutive ID number in JBPM_PROCESS_DEFINITION table. So the JBPM_PROCESS_DEFINITION table looks like that:

      ID | Name | ver| .... | ...
      --------------------------------------------------
       1 | websale | 1 | FALSE | 2
       2162 | SimpleSplitTest | 1 | FALSE | 2163
      ----------------------------------------------------
      



      why the SimpleSplitTest did not get ID = 2 ??


       public static void deployProcessPar(String filePath) throws JbpmAtflowException, FileNotFoundException {
       JbpmContext context = getAdminContext();
       try {
       ZipInputStream zip = new ZipInputStream(new FileInputStream(filePath));
       ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zip);
       context.deployProcessDefinition(processDefinition);
       }
       catch (Exception e) {
       throw new JbpmAtflowException("Could not deploy process PAR archive", e);
       }
       finally {
       context.close();
       }
       }