cancel
Showing results for 
Search instead for 
Did you mean: 

Sub-Process Migration Solution

wjeong
Champ in-the-making
Champ in-the-making
Does anybody have a good solution for migrating sub processes when updating the process definition?

I have a sub process defined with a simple "Start -> TaskInsideSubProcess -> End".  After I modify another task somewhere else in the definition, I deploy the file and use the SetProcessDefinitionVersionCmd to update all process instances.  The migration seemly works (no exception are thrown) but once that "TaskInsideSubProcess" is completed, the next task outside the sub process is not created.

My migration code is get all process instances:
    processEngine.getRuntimeService().createProcessInstanceQuery()
        .processDefinitionKey(definitionKey)
        .active()
        .list();

and iterate to migrate via:
    CommandExecutor commandExecutor = processEngineConfig.getJobExecutor().getCommandExecutor();
    commandExecutor.execute(new SetProcessDefinitionVersionCmd(processInstanceId, processDefinitionVersion));


Any input is appreciated.
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

SetProcessDefinitionVersionCmd sets process definition for executions. Is subprocess execution in the process instances list?
If not try to take subprocess execution and set process definition for the process execution too.

Regards
Martin