Package org.camunda.bpm.engine.impl.cmd
Class SetProcessDefinitionVersionCmd
java.lang.Object
org.camunda.bpm.engine.impl.cmd.SetProcessDefinitionVersionCmd
- All Implemented Interfaces:
- Serializable,- Command<Void>
Command that changes the process definition version of an existing
 process instance.
 Warning: This command will NOT perform any migration magic and simply set the
 process definition version in the database, assuming that the user knows,
 what he or she is doing.
 This is only useful for simple migrations. The new process definition MUST
 have the exact same activity id to make it still run.
 Furthermore, activities referenced by sub-executions and jobs that belong to
 the process instance MUST exist in the new process definition version.
 The command will fail, if there is already a ProcessInstance or
 HistoricProcessInstance using the new process definition version and
 the same business key as the ProcessInstance that is to be migrated.
 If the process instance is not currently waiting but actively running, then
 this would be a case for optimistic locking, meaning either the version
 update or the "real work" wins, i.e., this is a race condition.- Author:
- Falko Menge, Ingo Richtsmeier
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionSetProcessDefinitionVersionCmd(String processInstanceId, Integer processDefinitionVersion) 
- 
Method SummaryModifier and TypeMethodDescriptionexecute(CommandContext commandContext) getJobDefinitionMapping(List<JobDefinitionEntity> currentJobDefinitions, List<JobDefinitionEntity> newVersionJobDefinitions) protected booleanjobDefinitionsMatch(JobDefinitionEntity currentJobDefinition, JobDefinitionEntity newJobDefinition) protected voidswitchVersionOfIncident(CommandContext commandContext, IncidentEntity incidentEntity, ProcessDefinitionEntity newProcessDefinition) protected voidswitchVersionOfJob(JobEntity jobEntity, ProcessDefinitionEntity newProcessDefinition, Map<String, String> jobDefinitionMapping) protected voidvalidateAndSwitchVersionOfExecution(CommandContext commandContext, ExecutionEntity execution, ProcessDefinitionEntity newProcessDefinition) 
- 
Constructor Details- 
SetProcessDefinitionVersionCmd
 
- 
- 
Method Details- 
execute
- 
getJobDefinitionMappingprotected Map<String,String> getJobDefinitionMapping(List<JobDefinitionEntity> currentJobDefinitions, List<JobDefinitionEntity> newVersionJobDefinitions) 
- 
jobDefinitionsMatchprotected boolean jobDefinitionsMatch(JobDefinitionEntity currentJobDefinition, JobDefinitionEntity newJobDefinition) 
- 
switchVersionOfJobprotected void switchVersionOfJob(JobEntity jobEntity, ProcessDefinitionEntity newProcessDefinition, Map<String, String> jobDefinitionMapping) 
- 
switchVersionOfIncidentprotected void switchVersionOfIncident(CommandContext commandContext, IncidentEntity incidentEntity, ProcessDefinitionEntity newProcessDefinition) 
- 
validateAndSwitchVersionOfExecutionprotected void validateAndSwitchVersionOfExecution(CommandContext commandContext, ExecutionEntity execution, ProcessDefinitionEntity newProcessDefinition) 
 
-