Package org.camunda.bpm.engine.impl.cmd
Class SetProcessDefinitionVersionCmd
- java.lang.Object
-
- org.camunda.bpm.engine.impl.cmd.SetProcessDefinitionVersionCmd
-
- All Implemented Interfaces:
java.io.Serializable
,Command<java.lang.Void>
public class SetProcessDefinitionVersionCmd extends java.lang.Object implements Command<java.lang.Void>, java.io.Serializable
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 aProcessInstance
orHistoricProcessInstance
using the new process definition version and the same business key as theProcessInstance
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SetProcessDefinitionVersionCmd(java.lang.String processInstanceId, java.lang.Integer processDefinitionVersion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Void
execute(CommandContext commandContext)
protected java.util.Map<java.lang.String,java.lang.String>
getJobDefinitionMapping(java.util.List<JobDefinitionEntity> currentJobDefinitions, java.util.List<JobDefinitionEntity> newVersionJobDefinitions)
protected boolean
jobDefinitionsMatch(JobDefinitionEntity currentJobDefinition, JobDefinitionEntity newJobDefinition)
protected void
switchVersionOfIncident(CommandContext commandContext, IncidentEntity incidentEntity, ProcessDefinitionEntity newProcessDefinition)
protected void
switchVersionOfJob(JobEntity jobEntity, ProcessDefinitionEntity newProcessDefinition, java.util.Map<java.lang.String,java.lang.String> jobDefinitionMapping)
protected void
validateAndSwitchVersionOfExecution(CommandContext commandContext, ExecutionEntity execution, ProcessDefinitionEntity newProcessDefinition)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.impl.interceptor.Command
isRetryable
-
-
-
-
Method Detail
-
execute
public java.lang.Void execute(CommandContext commandContext)
-
getJobDefinitionMapping
protected java.util.Map<java.lang.String,java.lang.String> getJobDefinitionMapping(java.util.List<JobDefinitionEntity> currentJobDefinitions, java.util.List<JobDefinitionEntity> newVersionJobDefinitions)
-
jobDefinitionsMatch
protected boolean jobDefinitionsMatch(JobDefinitionEntity currentJobDefinition, JobDefinitionEntity newJobDefinition)
-
switchVersionOfJob
protected void switchVersionOfJob(JobEntity jobEntity, ProcessDefinitionEntity newProcessDefinition, java.util.Map<java.lang.String,java.lang.String> jobDefinitionMapping)
-
switchVersionOfIncident
protected void switchVersionOfIncident(CommandContext commandContext, IncidentEntity incidentEntity, ProcessDefinitionEntity newProcessDefinition)
-
validateAndSwitchVersionOfExecution
protected void validateAndSwitchVersionOfExecution(CommandContext commandContext, ExecutionEntity execution, ProcessDefinitionEntity newProcessDefinition)
-
-