use of org.camunda.bpm.engine.impl.migration.MigrationPlanImpl in project camunda-bpm-platform by camunda.
the class CreateMigrationPlanCmd method execute.
@Override
public MigrationPlan execute(CommandContext commandContext) {
ProcessDefinitionEntity sourceProcessDefinition = getProcessDefinition(commandContext, migrationBuilder.getSourceProcessDefinitionId(), "Source");
ProcessDefinitionEntity targetProcessDefinition = getProcessDefinition(commandContext, migrationBuilder.getTargetProcessDefinitionId(), "Target");
checkAuthorization(commandContext, sourceProcessDefinition, targetProcessDefinition);
MigrationPlanImpl migrationPlan = new MigrationPlanImpl(sourceProcessDefinition.getId(), targetProcessDefinition.getId());
List<MigrationInstruction> instructions = new ArrayList<MigrationInstruction>();
if (migrationBuilder.isMapEqualActivities()) {
instructions.addAll(generateInstructions(commandContext, sourceProcessDefinition, targetProcessDefinition, migrationBuilder.isUpdateEventTriggersForGeneratedInstructions()));
}
instructions.addAll(migrationBuilder.getExplicitMigrationInstructions());
migrationPlan.setInstructions(instructions);
validateMigrationPlan(commandContext, migrationPlan, sourceProcessDefinition, targetProcessDefinition);
return migrationPlan;
}
use of org.camunda.bpm.engine.impl.migration.MigrationPlanImpl in project camunda-bpm-platform by camunda.
the class MigrationPlanJsonConverter method toObject.
public MigrationPlan toObject(JSONObject json) {
MigrationPlanImpl migrationPlan = new MigrationPlanImpl(json.getString(SOURCE_PROCESS_DEFINITION_ID), json.getString(TARGET_PROCESS_DEFINITION_ID));
migrationPlan.setInstructions(JsonUtil.jsonArrayAsList(json.getJSONArray(INSTRUCTIONS), MigrationInstructionJsonConverter.INSTANCE));
return migrationPlan;
}
Aggregations