"'"+processInstanceId+"' " +
"points to a child execution of process instance " +
"'"+processInstance.getProcessInstanceId()+"'. " +
"Please invoke the "+getClass().getSimpleName()+" with a root execution id.");
}
ProcessDefinitionImpl currentProcessDefinitionImpl = processInstance.getProcessDefinition();
DeploymentCache deploymentCache = Context
.getProcessEngineConfiguration()
.getDeploymentCache();
ProcessDefinitionEntity currentProcessDefinition;
if (currentProcessDefinitionImpl instanceof ProcessDefinitionEntity) {
currentProcessDefinition = (ProcessDefinitionEntity) currentProcessDefinitionImpl;
} else {
currentProcessDefinition = deploymentCache.findDeployedProcessDefinitionById(currentProcessDefinitionImpl.getId());
}
ProcessDefinitionEntity newProcessDefinition = deploymentCache
.findDeployedProcessDefinitionByKeyAndVersion(currentProcessDefinition.getKey(), processDefinitionVersion);