-
1. Re: Deploy new version of a Process defintion loaded and upd
kukeltje Nov 22, 2006 8:56 AM (in response to matthieugd)by passing on a version number? Otherwise look at how the webapp/servlet does it.
-
2. Re: Deploy new version of a Process defintion loaded and upd
matthieugd Nov 22, 2006 9:37 AM (in response to matthieugd)"kukeltje" wrote:
by passing on a version number? Otherwise look at how the webapp/servlet does it.
Passing a version number ? The deploy method of GraphSession already increments the version number.
You can't change a process definition in the webapp, can't you ? You deploy a process defintion in a par file. What I want : modify a process definition and deploy it as a new version of the existing one trough the API.
Matthieu -
3. Re: Deploy new version of a Process defintion loaded and upd
kukeltje Nov 22, 2006 12:50 PM (in response to matthieugd)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 seepublic 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..... -
4. Re: Deploy new version of a Process defintion loaded and upd
matthieugd Nov 22, 2006 1:10 PM (in response to matthieugd)"kukeltje" wrote:
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);
yes :) If you read my previous message you'll see that I've read the code when I say "The deploy method of GraphSession already increments the version number.""kukeltje" wrote:
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.....
okay I fear that it would be the problem. -
5. Re: Deploy new version of a Process defintion loaded and upd
kukeltje Nov 22, 2006 2:56 PM (in response to matthieugd)I (mis)read your previous message... shame on me (don't know the 'shame' smiley)
Maybe the hibernate docs/wiki/forum can answer this for you. I am curious btw to the outcome -
6. Re: Deploy new version of a Process defintion loaded and upd
matthieugd Nov 22, 2006 3:07 PM (in response to matthieugd)No problem :)
I will look deeper soon but maybe I should go trough the graph of object from the ProcessDefinition and set the ID to 0 since Hibernate check the ID attribute to save or update.
Matthieu -
7. Re: Deploy new version of a Process defintion loaded and upd
clandestino_bgd Jun 6, 2007 12:39 PM (in response to matthieugd)Hi, we have a very same problem.
There is a requirement to edit process definition on fly (workflow composition by common user, not developer). So, we have template process definition, which can be customized through some interface. The result should be modified copy of template process definition.
The mentioned issue with Hibernate we have already faced.
Any hint, about the best way for that.
Thanx
Milan