Class MigrationPlanBuilderImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.migration.MigrationPlanBuilderImpl
-
- All Implemented Interfaces:
MigrationInstructionBuilder
,MigrationInstructionsBuilder
,MigrationPlanBuilder
public class MigrationPlanBuilderImpl extends java.lang.Object implements MigrationInstructionBuilder, MigrationInstructionsBuilder
- Author:
- Thorben Lindhauer
-
-
Field Summary
Fields Modifier and Type Field Description protected CommandExecutor
commandExecutor
protected java.util.List<MigrationInstructionImpl>
explicitMigrationInstructions
protected boolean
mapEqualActivities
protected java.lang.String
sourceProcessDefinitionId
protected java.lang.String
targetProcessDefinitionId
protected boolean
updateEventTriggersForGeneratedInstructions
protected VariableMap
variables
-
Constructor Summary
Constructors Constructor Description MigrationPlanBuilderImpl(CommandExecutor commandExecutor, java.lang.String sourceProcessDefinitionId, java.lang.String targetProcessDefinitionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MigrationPlan
build()
java.util.List<MigrationInstructionImpl>
getExplicitMigrationInstructions()
java.lang.String
getSourceProcessDefinitionId()
java.lang.String
getTargetProcessDefinitionId()
VariableMap
getVariables()
boolean
isMapEqualActivities()
boolean
isUpdateEventTriggersForGeneratedInstructions()
MigrationInstructionBuilder
mapActivities(java.lang.String sourceActivityId, java.lang.String targetActivityId)
Adds a migration instruction that maps activity instances of the source activity (of the source process definition) to activity instances of the target activity (of the target process definition)MigrationInstructionsBuilder
mapEqualActivities()
Automatically adds a set of instructions for activities that are equivalent in both process definitions.MigrationPlanBuilder
setVariables(java.util.Map<java.lang.String,?> variables)
MigrationInstructionBuilder
updateEventTrigger()
If the current instruction maps between event-receiving flow nodes that rely on a persistent event trigger, this method can be used to determine whether the event trigger should be updated during migrationMigrationInstructionsBuilder
updateEventTriggers()
Toggle whether the instructions should include updating of the respective event triggers where appropriate.
-
-
-
Field Detail
-
commandExecutor
protected CommandExecutor commandExecutor
-
sourceProcessDefinitionId
protected java.lang.String sourceProcessDefinitionId
-
targetProcessDefinitionId
protected java.lang.String targetProcessDefinitionId
-
explicitMigrationInstructions
protected java.util.List<MigrationInstructionImpl> explicitMigrationInstructions
-
mapEqualActivities
protected boolean mapEqualActivities
-
updateEventTriggersForGeneratedInstructions
protected boolean updateEventTriggersForGeneratedInstructions
-
variables
protected VariableMap variables
-
-
Constructor Detail
-
MigrationPlanBuilderImpl
public MigrationPlanBuilderImpl(CommandExecutor commandExecutor, java.lang.String sourceProcessDefinitionId, java.lang.String targetProcessDefinitionId)
-
-
Method Detail
-
mapEqualActivities
public MigrationInstructionsBuilder mapEqualActivities()
Description copied from interface:MigrationPlanBuilder
Automatically adds a set of instructions for activities that are equivalent in both process definitions. By default, this is given if two activities are both user tasks, are on the same level of sub process, and have the same id.- Specified by:
mapEqualActivities
in interfaceMigrationPlanBuilder
-
setVariables
public MigrationPlanBuilder setVariables(java.util.Map<java.lang.String,?> variables)
- Specified by:
setVariables
in interfaceMigrationPlanBuilder
- Parameters:
variables
- which will be set into the process instance scope after the migration
-
mapActivities
public MigrationInstructionBuilder mapActivities(java.lang.String sourceActivityId, java.lang.String targetActivityId)
Description copied from interface:MigrationPlanBuilder
Adds a migration instruction that maps activity instances of the source activity (of the source process definition) to activity instances of the target activity (of the target process definition)- Specified by:
mapActivities
in interfaceMigrationPlanBuilder
-
updateEventTrigger
public MigrationInstructionBuilder updateEventTrigger()
Description copied from interface:MigrationInstructionBuilder
If the current instruction maps between event-receiving flow nodes that rely on a persistent event trigger, this method can be used to determine whether the event trigger should be updated during migration
For example, when mapping a message catch event waiting for message A to another message catch waiting for message B, using this option updates the message trigger to B during migration. That means, after migration this process instance can be correlated to using B. If this option is not used, then the message trigger is not updated and A is the message to be received after migration.
Event-receiving flow nodes are:
- intermediate events (signal, message, timer)
- boundary events (signal, message, timer)
- start events (signal, message, timer)
- receive tasks
For other flow nodes, this option must not be used and if so, results in a validation exception when the plan is created
- Specified by:
updateEventTrigger
in interfaceMigrationInstructionBuilder
- Returns:
- this builder
-
updateEventTriggers
public MigrationInstructionsBuilder updateEventTriggers()
Description copied from interface:MigrationInstructionsBuilder
Toggle whether the instructions should include updating of the respective event triggers where appropriate. SeeMigrationInstructionBuilder.updateEventTrigger()
for details what updating the event trigger means for a single instruction.- Specified by:
updateEventTriggers
in interfaceMigrationInstructionsBuilder
- Returns:
- this builder
-
getSourceProcessDefinitionId
public java.lang.String getSourceProcessDefinitionId()
-
getTargetProcessDefinitionId
public java.lang.String getTargetProcessDefinitionId()
-
isMapEqualActivities
public boolean isMapEqualActivities()
-
getVariables
public VariableMap getVariables()
-
isUpdateEventTriggersForGeneratedInstructions
public boolean isUpdateEventTriggersForGeneratedInstructions()
-
getExplicitMigrationInstructions
public java.util.List<MigrationInstructionImpl> getExplicitMigrationInstructions()
-
build
public MigrationPlan build()
- Specified by:
build
in interfaceMigrationPlanBuilder
- Returns:
- a migration plan with all previously specified instructions
-
-