use of org.camunda.bpm.engine.migration.MigrationInstructionBuilder in project camunda-bpm-platform by camunda.
the class MigrationPlanDto method toMigrationPlan.
public static MigrationPlan toMigrationPlan(ProcessEngine processEngine, MigrationPlanDto migrationPlanDto) {
MigrationPlanBuilder migrationPlanBuilder = processEngine.getRuntimeService().createMigrationPlan(migrationPlanDto.getSourceProcessDefinitionId(), migrationPlanDto.getTargetProcessDefinitionId());
if (migrationPlanDto.getInstructions() != null) {
for (MigrationInstructionDto migrationInstructionDto : migrationPlanDto.getInstructions()) {
MigrationInstructionBuilder migrationInstructionBuilder = migrationPlanBuilder.mapActivities(migrationInstructionDto.getSourceActivityIds().get(0), migrationInstructionDto.getTargetActivityIds().get(0));
if (Boolean.TRUE.equals(migrationInstructionDto.isUpdateEventTrigger())) {
migrationInstructionBuilder = migrationInstructionBuilder.updateEventTrigger();
}
migrationPlanBuilder = migrationInstructionBuilder;
}
}
return migrationPlanBuilder.build();
}
Aggregations