[jboss-user] [JBoss jBPM] - Re: Deploy new version of a Process defintion loaded and upd

kukeltje do-not-reply at jboss.com
Wed Nov 22 12:50:35 EST 2006

the API (JbpmContext) has a method deployProcessDefinition. If you dig into this (the code IS open you know, you will see a getGraphSession().deployProcessDefinition(processDefinition);

and if you go into that, you will see 
  public void deployProcessDefinition(ProcessDefinition processDefinition) {
  |     String processDefinitionName = processDefinition.getName();
  |     // if the process definition has a name (process versioning only applies to named process definitions)
  |     if (processDefinitionName!=null) {
  |       // find the current latest process definition
  |       ProcessDefinition previousLatestVersion = findLatestProcessDefinition(processDefinitionName);
  |       // if there is a current latest process definition
  |       if (previousLatestVersion!=null) {
  |         // take the next version number
  |         processDefinition.setVersion( previousLatestVersion.getVersion()+1 );
  |       } else {
  |         // start from 1
  |         processDefinition.setVersion(1);
  |       }
  |       session.save(processDefinition);
  |     } else {
  |       throw new JbpmException("process definition does not have a name");
  |     }
  |   }

So deploying a pd via the api increments the version. 

Ahhh wait.... that is not what you meant right.......

you want to make a copy of the pd, change that and deploy it. Remember, this is hibernate etc... just changing the pd and nodes below, changes all nodes currently loaded and will update them..... you have to make a full copy not change the existing loaded pd and deploy it again.....

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987957#3987957

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987957

More information about the jboss-user mailing list