Class MigrateProcessInstanceCmd
java.lang.Object
org.camunda.bpm.engine.impl.migration.AbstractMigrationCmd
org.camunda.bpm.engine.impl.migration.MigrateProcessInstanceCmd
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 inherited from class org.camunda.bpm.engine.impl.migration.AbstractMigrationCmd
executionBuilder
-
Constructor Summary
ConstructorDescriptionMigrateProcessInstanceCmd
(MigrationPlanExecutionBuilderImpl migrationPlanExecutionBuilder, boolean skipJavaSerializationFormatCheck) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
(String processInstanceId, ExecutionEntity processInstance) protected void
ensureSameProcessDefinition
(ExecutionEntity processInstance, String processDefinitionId) execute
(CommandContext commandContext) protected <T> void
executeInContext
(Runnable runnable, ProcessDefinitionEntity contextDefinition) migrateProcessInstance
(CommandContext commandContext, String processInstanceId, MigrationPlan migrationPlan, ProcessDefinitionEntity targetProcessDefinition, boolean skipJavaSerializationFormatCheck) protected void
migrateProcessInstance
(MigratingProcessInstance migratingProcessInstance) Migrate activity instances to their new activities and process definition.validateActivityInstance
(MigratingActivityInstance migratingActivityInstance, MigratingProcessInstance migratingProcessInstance, List<MigratingActivityInstanceValidator> migratingActivityInstanceValidators) protected void
validateCompensateSubscriptionInstance
(MigratingCompensationEventSubscriptionInstance eventSubscriptionInstance, MigratingProcessInstance migratingProcessInstance, List<MigratingCompensationInstanceValidator> migratingTransitionInstanceValidators, MigratingActivityInstanceValidationReportImpl instanceReport) protected void
validateEventScopeInstance
(MigratingEventScopeInstance eventScopeInstance, MigratingProcessInstance migratingProcessInstance, List<MigratingCompensationInstanceValidator> migratingTransitionInstanceValidators, MigratingActivityInstanceValidationReportImpl instanceReport) protected void
validateInstructions
(CommandContext commandContext, MigratingProcessInstance migratingProcessInstance, MigratingProcessInstanceValidationReportImpl processInstanceReport) validateTransitionInstance
(MigratingTransitionInstance migratingTransitionInstance, MigratingProcessInstance migratingProcessInstance, 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 Details
-
LOGGER
-
skipJavaSerializationFormatCheck
protected boolean skipJavaSerializationFormatCheck
-
-
Constructor Details
-
MigrateProcessInstanceCmd
public MigrateProcessInstanceCmd(MigrationPlanExecutionBuilderImpl migrationPlanExecutionBuilder, boolean skipJavaSerializationFormatCheck)
-
-
Method Details
-
execute
-
migrateProcessInstance
public Void migrateProcessInstance(CommandContext commandContext, String processInstanceId, MigrationPlan migrationPlan, ProcessDefinitionEntity targetProcessDefinition, boolean skipJavaSerializationFormatCheck) -
executeInContext
-
deleteUnmappedActivityInstances
delete unmapped instances in a bottom-up fashion (similar to deleteCascade and regular BPMN execution) -
collectLeafInstances
protected Set<MigratingScopeInstance> collectLeafInstances(MigratingProcessInstance migratingProcessInstance) -
validateInstructions
protected void validateInstructions(CommandContext commandContext, MigratingProcessInstance migratingProcessInstance, MigratingProcessInstanceValidationReportImpl processInstanceReport) -
validateActivityInstance
protected MigratingActivityInstanceValidationReportImpl validateActivityInstance(MigratingActivityInstance migratingActivityInstance, MigratingProcessInstance migratingProcessInstance, List<MigratingActivityInstanceValidator> migratingActivityInstanceValidators) -
validateTransitionInstance
protected MigratingTransitionInstanceValidationReportImpl validateTransitionInstance(MigratingTransitionInstance migratingTransitionInstance, MigratingProcessInstance migratingProcessInstance, List<MigratingTransitionInstanceValidator> migratingTransitionInstanceValidators) -
validateEventScopeInstance
protected void validateEventScopeInstance(MigratingEventScopeInstance eventScopeInstance, MigratingProcessInstance migratingProcessInstance, List<MigratingCompensationInstanceValidator> migratingTransitionInstanceValidators, MigratingActivityInstanceValidationReportImpl instanceReport) -
validateCompensateSubscriptionInstance
protected void validateCompensateSubscriptionInstance(MigratingCompensationEventSubscriptionInstance eventSubscriptionInstance, MigratingProcessInstance migratingProcessInstance, List<MigratingCompensationInstanceValidator> migratingTransitionInstanceValidators, MigratingActivityInstanceValidationReportImpl instanceReport) -
migrateProcessInstance
Migrate activity instances to their new activities and process definition. Creates new scope instances as necessary. -
ensureProcessInstanceExist
protected void ensureProcessInstanceExist(String processInstanceId, ExecutionEntity processInstance) -
ensureSameProcessDefinition
protected void ensureSameProcessDefinition(ExecutionEntity processInstance, String processDefinitionId) -
ensureOperationAllowed
protected void ensureOperationAllowed(CommandContext commandContext, ExecutionEntity processInstance, ProcessDefinitionEntity targetProcessDefinition)
-