Class MigrateProcessInstanceCmd
- java.lang.Object
-
- org.camunda.bpm.engine.impl.migration.AbstractMigrationCmd
-
- org.camunda.bpm.engine.impl.migration.MigrateProcessInstanceCmd
-
- All Implemented Interfaces:
Command<java.lang.Void>
public class MigrateProcessInstanceCmd extends AbstractMigrationCmd implements Command<java.lang.Void>
How migration works:- Validate migration instructions.
- Delete activity instances that are not going to be migrated, invoking execution listeners and io mappings. This is performed in a bottom-up fashion in the activity instance tree and ensures that the "upstream" tree is always consistent with respect to the old process definition.
- Migrate and create activity instances. Creation invokes execution listeners and io mappings. This is performed in a top-down fashion in the activity instance tree and ensures that the "upstream" tree is always consistent with respect to the new process definition.
- Author:
- Thorben Lindhauer
-
-
Field Summary
Fields Modifier and Type Field Description protected static MigrationLogger
LOGGER
protected boolean
skipJavaSerializationFormatCheck
-
Fields inherited from class org.camunda.bpm.engine.impl.migration.AbstractMigrationCmd
executionBuilder
-
-
Constructor Summary
Constructors Constructor Description MigrateProcessInstanceCmd(MigrationPlanExecutionBuilderImpl migrationPlanExecutionBuilder, boolean skipJavaSerializationFormatCheck)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Set<MigratingScopeInstance>
collectLeafInstances(MigratingProcessInstance migratingProcessInstance)
protected void
deleteUnmappedActivityInstances(MigratingProcessInstance migratingProcessInstance)
delete unmapped instances in a bottom-up fashion (similar to deleteCascade and regular BPMN execution)protected void
ensureOperationAllowed(CommandContext commandContext, ExecutionEntity processInstance, ProcessDefinitionEntity targetProcessDefinition)
protected void
ensureProcessInstanceExist(java.lang.String processInstanceId, ExecutionEntity processInstance)
protected void
ensureSameProcessDefinition(ExecutionEntity processInstance, java.lang.String processDefinitionId)
java.lang.Void
execute(CommandContext commandContext)
protected <T> void
executeInContext(java.lang.Runnable runnable, ProcessDefinitionEntity contextDefinition)
java.lang.Void
migrateProcessInstance(CommandContext commandContext, java.lang.String processInstanceId, MigrationPlan migrationPlan, ProcessDefinitionEntity targetProcessDefinition, boolean skipJavaSerializationFormatCheck)
protected void
migrateProcessInstance(MigratingProcessInstance migratingProcessInstance)
Migrate activity instances to their new activities and process definition.protected MigratingActivityInstanceValidationReportImpl
validateActivityInstance(MigratingActivityInstance migratingActivityInstance, MigratingProcessInstance migratingProcessInstance, java.util.List<MigratingActivityInstanceValidator> migratingActivityInstanceValidators)
protected void
validateCompensateSubscriptionInstance(MigratingCompensationEventSubscriptionInstance eventSubscriptionInstance, MigratingProcessInstance migratingProcessInstance, java.util.List<MigratingCompensationInstanceValidator> migratingTransitionInstanceValidators, MigratingActivityInstanceValidationReportImpl instanceReport)
protected void
validateEventScopeInstance(MigratingEventScopeInstance eventScopeInstance, MigratingProcessInstance migratingProcessInstance, java.util.List<MigratingCompensationInstanceValidator> migratingTransitionInstanceValidators, MigratingActivityInstanceValidationReportImpl instanceReport)
protected void
validateInstructions(CommandContext commandContext, MigratingProcessInstance migratingProcessInstance, MigratingProcessInstanceValidationReportImpl processInstanceReport)
protected MigratingTransitionInstanceValidationReportImpl
validateTransitionInstance(MigratingTransitionInstance migratingTransitionInstance, MigratingProcessInstance migratingProcessInstance, java.util.List<MigratingTransitionInstanceValidator> migratingTransitionInstanceValidators)
-
Methods inherited from class org.camunda.bpm.engine.impl.migration.AbstractMigrationCmd
checkAuthorizations, collectProcessInstanceIds, getProcessDefinition, resolveSourceProcessDefinition, resolveTargetProcessDefinition, writeUserOperationLog
-
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
-
-
-
-
Field Detail
-
LOGGER
protected static final MigrationLogger LOGGER
-
skipJavaSerializationFormatCheck
protected boolean skipJavaSerializationFormatCheck
-
-
Constructor Detail
-
MigrateProcessInstanceCmd
public MigrateProcessInstanceCmd(MigrationPlanExecutionBuilderImpl migrationPlanExecutionBuilder, boolean skipJavaSerializationFormatCheck)
-
-
Method Detail
-
execute
public java.lang.Void execute(CommandContext commandContext)
-
migrateProcessInstance
public java.lang.Void migrateProcessInstance(CommandContext commandContext, java.lang.String processInstanceId, MigrationPlan migrationPlan, ProcessDefinitionEntity targetProcessDefinition, boolean skipJavaSerializationFormatCheck)
-
executeInContext
protected <T> void executeInContext(java.lang.Runnable runnable, ProcessDefinitionEntity contextDefinition)
-
deleteUnmappedActivityInstances
protected void deleteUnmappedActivityInstances(MigratingProcessInstance migratingProcessInstance)
delete unmapped instances in a bottom-up fashion (similar to deleteCascade and regular BPMN execution)
-
collectLeafInstances
protected java.util.Set<MigratingScopeInstance> collectLeafInstances(MigratingProcessInstance migratingProcessInstance)
-
validateInstructions
protected void validateInstructions(CommandContext commandContext, MigratingProcessInstance migratingProcessInstance, MigratingProcessInstanceValidationReportImpl processInstanceReport)
-
validateActivityInstance
protected MigratingActivityInstanceValidationReportImpl validateActivityInstance(MigratingActivityInstance migratingActivityInstance, MigratingProcessInstance migratingProcessInstance, java.util.List<MigratingActivityInstanceValidator> migratingActivityInstanceValidators)
-
validateTransitionInstance
protected MigratingTransitionInstanceValidationReportImpl validateTransitionInstance(MigratingTransitionInstance migratingTransitionInstance, MigratingProcessInstance migratingProcessInstance, java.util.List<MigratingTransitionInstanceValidator> migratingTransitionInstanceValidators)
-
validateEventScopeInstance
protected void validateEventScopeInstance(MigratingEventScopeInstance eventScopeInstance, MigratingProcessInstance migratingProcessInstance, java.util.List<MigratingCompensationInstanceValidator> migratingTransitionInstanceValidators, MigratingActivityInstanceValidationReportImpl instanceReport)
-
validateCompensateSubscriptionInstance
protected void validateCompensateSubscriptionInstance(MigratingCompensationEventSubscriptionInstance eventSubscriptionInstance, MigratingProcessInstance migratingProcessInstance, java.util.List<MigratingCompensationInstanceValidator> migratingTransitionInstanceValidators, MigratingActivityInstanceValidationReportImpl instanceReport)
-
migrateProcessInstance
protected void migrateProcessInstance(MigratingProcessInstance migratingProcessInstance)
Migrate activity instances to their new activities and process definition. Creates new scope instances as necessary.
-
ensureProcessInstanceExist
protected void ensureProcessInstanceExist(java.lang.String processInstanceId, ExecutionEntity processInstance)
-
ensureSameProcessDefinition
protected void ensureSameProcessDefinition(ExecutionEntity processInstance, java.lang.String processDefinitionId)
-
ensureOperationAllowed
protected void ensureOperationAllowed(CommandContext commandContext, ExecutionEntity processInstance, ProcessDefinitionEntity targetProcessDefinition)
-
-