cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrading to the latest process version

plehal
Champ in-the-making
Champ in-the-making
What is the easiest way to upgrade the running process instance to the latest process deployment version if some one wants to do it?  Does updating the proc_def_id_  in database tables suffice or something else needs to be taken care of? Help, Please!!!!!!!!!!
4 REPLIES 4

trademak
Star Contributor
Star Contributor
Hi,

This is not a very easy task. What kind of changes did you make between the old and the new process definition?
Yes, you would have to update the PROC_DEF_ID_ column for the running process instance, but you also need to do that for the history table if you want to keep that information as well.
But be aware that you might run into a lot of difficulties here, depending on the changes that are made to the process definition.

Best regards,

plehal
Champ in-the-making
Champ in-the-making
Thanks for the quick response. Yes, I do understand that I may run into problems/issues but this is one feature which I need as I am using Activiti in production environment and sometimes as part of business process modifications we are making slight changes to the process like adding or deleting task listeners. I understand as long as we don't add or delete task nodes or rename them….everything should be alright. All I need to know is name of all the tables where I need to update the process definition reference. I will have to live with this hack until this feature becomes part of official release. Will you be so kind to tell the table name which use reference to process definitions……? Thanks again.

plehal
Champ in-the-making
Champ in-the-making
So far I have come up with following :

update  ACT_RU_EXECUTION set PROC_DEF_ID_=(" +
   "select ID_ from ACT_RE_PROCDEF where ID_ like 'ECR%' order by version_ desc limit 1 " +
   ")" +
   " where PROC_DEF_ID_ like 'ECR%'"  ;



update  ACT_RU_TASK set PROC_DEF_ID_=(" +
  "select ID_ from ACT_RE_PROCDEF where ID_ like 'ECR%' order by version_ desc limit 1" +
  ") " +
  "where PROC_DEF_ID_ like 'ECR%'" ;


update  ACT_HI_PROCINST set PROC_DEF_ID_=(" +
  "select ID_ from ACT_RE_PROCDEF where ID_ like 'ECR%' order by version_ desc limit 1" +
  ") " +
  "where PROC_DEF_ID_ like 'ECR%';

update  ACT_HI_TASKINST set PROC_DEF_ID_=(" +
  "select ID_ from ACT_RE_PROCDEF where ID_ like 'ECR%' order by version_ desc limit 1" +
  ") " +
  "where PROC_DEF_ID_ like 'ECR%'";


update  ACT_HI_ACTINST set PROC_DEF_ID_=(" +
  "select ID_ from ACT_RE_PROCDEF where ID_ like 'ECR%' order by version_ desc limit 1" +
  ") " +
  "where PROC_DEF_ID_ like 'ECR%';

Please, note that the code has been copied from a java program, so it has some extra characters………..

naag
Champ in-the-making
Champ in-the-making
Without having done this before, I read sometimes about SetProcessDefinitionVersionCmd on the forums (it's not documented). You might want to take a look at that class and see if it fits your use case.