Search in sources :

Example 1 with MigrationInstructionValidator

use of org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidator 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)

Example 2 with MigrationInstructionValidator

use of org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidator in project camunda-bpm-platform by camunda.

the class ProcessEngineConfigurationImpl method getDefaultMigrationInstructionValidators.

public List<MigrationInstructionValidator> getDefaultMigrationInstructionValidators() {
    List<MigrationInstructionValidator> migrationInstructionValidators = new ArrayList<MigrationInstructionValidator>();
    migrationInstructionValidators.add(new SameBehaviorInstructionValidator());
    migrationInstructionValidators.add(new SameEventTypeValidator());
    migrationInstructionValidators.add(new OnlyOnceMappedActivityInstructionValidator());
    migrationInstructionValidators.add(new CannotAddMultiInstanceBodyValidator());
    migrationInstructionValidators.add(new CannotAddMultiInstanceInnerActivityValidator());
    migrationInstructionValidators.add(new CannotRemoveMultiInstanceInnerActivityValidator());
    migrationInstructionValidators.add(new GatewayMappingValidator());
    migrationInstructionValidators.add(new SameEventScopeInstructionValidator());
    migrationInstructionValidators.add(new UpdateEventTriggersValidator());
    migrationInstructionValidators.add(new AdditionalFlowScopeInstructionValidator());
    migrationInstructionValidators.add(new ConditionalEventUpdateEventTriggerValidator());
    return migrationInstructionValidators;
}
Also used : OnlyOnceMappedActivityInstructionValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.OnlyOnceMappedActivityInstructionValidator) AdditionalFlowScopeInstructionValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.AdditionalFlowScopeInstructionValidator) MigrationInstructionValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidator) ArrayList(java.util.ArrayList) SameEventTypeValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.SameEventTypeValidator) CannotRemoveMultiInstanceInnerActivityValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.CannotRemoveMultiInstanceInnerActivityValidator) SameEventScopeInstructionValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.SameEventScopeInstructionValidator) CannotAddMultiInstanceInnerActivityValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.CannotAddMultiInstanceInnerActivityValidator) ConditionalEventUpdateEventTriggerValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.ConditionalEventUpdateEventTriggerValidator) UpdateEventTriggersValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.UpdateEventTriggersValidator) GatewayMappingValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.GatewayMappingValidator) SameBehaviorInstructionValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.SameBehaviorInstructionValidator) CannotAddMultiInstanceBodyValidator(org.camunda.bpm.engine.impl.migration.validation.instruction.CannotAddMultiInstanceBodyValidator)

Aggregations

MigrationInstructionValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidator)2 ArrayList (java.util.ArrayList)1 AdditionalFlowScopeInstructionValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.AdditionalFlowScopeInstructionValidator)1 CannotAddMultiInstanceBodyValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.CannotAddMultiInstanceBodyValidator)1 CannotAddMultiInstanceInnerActivityValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.CannotAddMultiInstanceInnerActivityValidator)1 CannotRemoveMultiInstanceInnerActivityValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.CannotRemoveMultiInstanceInnerActivityValidator)1 ConditionalEventUpdateEventTriggerValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.ConditionalEventUpdateEventTriggerValidator)1 GatewayMappingValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.GatewayMappingValidator)1 MigrationInstructionValidationReportImpl (org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidationReportImpl)1 MigrationPlanValidationReportImpl (org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationPlanValidationReportImpl)1 OnlyOnceMappedActivityInstructionValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.OnlyOnceMappedActivityInstructionValidator)1 SameBehaviorInstructionValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.SameBehaviorInstructionValidator)1 SameEventScopeInstructionValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.SameEventScopeInstructionValidator)1 SameEventTypeValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.SameEventTypeValidator)1 UpdateEventTriggersValidator (org.camunda.bpm.engine.impl.migration.validation.instruction.UpdateEventTriggersValidator)1 ValidatingMigrationInstruction (org.camunda.bpm.engine.impl.migration.validation.instruction.ValidatingMigrationInstruction)1 ValidatingMigrationInstructions (org.camunda.bpm.engine.impl.migration.validation.instruction.ValidatingMigrationInstructions)1