.findDeployedProcessDefinitionByKeyAndVersion(currentProcessDefinition.getKey(), processDefinitionVersion);
validateAndSwitchVersionOfExecution(commandContext, processInstance, newProcessDefinition);
// switch the historic process instance to the new process definition version
HistoricProcessInstanceManager historicProcessInstanceManager = commandContext.getHistoricProcessInstanceManager();
if (historicProcessInstanceManager.isHistoryEnabled()) {
HistoricProcessInstanceEntity historicProcessInstance = historicProcessInstanceManager.findHistoricProcessInstance(processInstanceId);
historicProcessInstance.setProcessDefinitionId(newProcessDefinition.getId());
}
// switch all sub-executions of the process instance to the new process definition version
List<ExecutionEntity> childExecutions = executionManager