Search in sources :

Example 1 with MigrationInstructionBuilder

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();
}
Also used : MigrationPlanBuilder(org.camunda.bpm.engine.migration.MigrationPlanBuilder) MigrationInstructionBuilder(org.camunda.bpm.engine.migration.MigrationInstructionBuilder)

Aggregations

MigrationInstructionBuilder (org.camunda.bpm.engine.migration.MigrationInstructionBuilder)1 MigrationPlanBuilder (org.camunda.bpm.engine.migration.MigrationPlanBuilder)1