use of org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationPlanValidationReportImpl in project camunda-bpm-platform by camunda.
the class CreateMigrationPlanCmd method validateMigrationPlan.
protected void validateMigrationPlan(CommandContext commandContext, MigrationPlanImpl migrationPlan, ProcessDefinitionImpl sourceProcessDefinition, ProcessDefinitionImpl targetProcessDefinition) {
List<MigrationInstructionValidator> migrationInstructionValidators = commandContext.getProcessEngineConfiguration().getMigrationInstructionValidators();
MigrationPlanValidationReportImpl planReport = new MigrationPlanValidationReportImpl(migrationPlan);
ValidatingMigrationInstructions validatingMigrationInstructions = wrapMigrationInstructions(migrationPlan, sourceProcessDefinition, targetProcessDefinition, planReport);
for (ValidatingMigrationInstruction validatingMigrationInstruction : validatingMigrationInstructions.getInstructions()) {
MigrationInstructionValidationReportImpl instructionReport = validateInstruction(validatingMigrationInstruction, validatingMigrationInstructions, migrationInstructionValidators);
if (instructionReport.hasFailures()) {
planReport.addInstructionReport(instructionReport);
}
}
if (planReport.hasInstructionReports()) {
throw LOG.failingMigrationPlanValidation(planReport);
}
}
Aggregations