cancel
Showing results for 
Search instead for 
Did you mean: 

Behavior of CallActivity when deploying new versions

ndt
Champ in-the-making
Champ in-the-making
Hi

If i have a deployment with a process (process1) containing a CallActivity starting another process (process2) then deploy a new version of these processes, what will the existing process instances of process1 start when reaching the CallActivity starting process2. The version from the old deployment, from which the process instance is started, or the new version?

The reason that I am asking is that we have this situation where we have added some new parameters to process2 and now all existing instances from the old version is failing when starting(and executing) process2 with the message that the new property does not exist.
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
A call-activity by default, calls the latest version of the process that is configured in "calledElement".

ndt
Champ in-the-making
Champ in-the-making
A call-activity by default, calls the latest version of the process that is configured in "calledElement".

What are the possibilities for having it call a older version?

frederikherema1
Star Contributor
Star Contributor

public void execute(ActivityExecution execution) throws Exception {
   
String processDefinitonKey = this.processDefinitonKey;
    if (processDefinitionExpression != null) {
      processDefinitonKey = (String) processDefinitionExpression.getValue(execution);
    }
   
    ProcessDefinitionImpl processDefinition = Context
      .getProcessEngineConfiguration()
      .getDeploymentManager()
      .findDeployedLatestProcessDefinitionByKey(processDefinitonKey);
   
    PvmProcessInstance subProcessInstance = execution.createSubProcessInstance(processDefinition);

You'll have to extend the CallActivityBehavior to use, for example, a fixed processDefinition ID instead of a key in the field processDefinitionExpression (which corresponds to the BPMN calledElement). You can easily alter the ActivityBehaviorFactory used by the latests parser in order to accomplish this. If you're not able to wait for the 5.12 version, you'll have to use a BPMNParseListener and replace the ActivitiyBehaviour yourself when the process us parsed.