Search in sources :

Example 1 with MigrationPlanValidationReportImpl

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);
    }
}
Also used : MigrationInstructionValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidator) MigrationInstructionValidationReportImpl(org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidationReportImpl) ValidatingMigrationInstructions(org.camunda.bpm.engine.impl.migration.validation.instruction.ValidatingMigrationInstructions) MigrationPlanValidationReportImpl(org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationPlanValidationReportImpl) ValidatingMigrationInstruction(org.camunda.bpm.engine.impl.migration.validation.instruction.ValidatingMigrationInstruction)

Aggregations

MigrationInstructionValidationReportImpl (org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidationReportImpl)1 MigrationInstructionValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidator)1 MigrationPlanValidationReportImpl (org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationPlanValidationReportImpl)1 ValidatingMigrationInstruction (org.camunda.bpm.engine.impl.migration.validation.instruction.ValidatingMigrationInstruction)1 ValidatingMigrationInstructions (org.camunda.bpm.engine.impl.migration.validation.instruction.ValidatingMigrationInstructions)1