Search in sources :

Example 1 with MigratingTransitionInstanceValidator

use of org.camunda.bpm.engine.impl.migration.validation.instance.MigratingTransitionInstanceValidator in project camunda-bpm-platform by camunda.

the class ProcessEngineConfigurationImpl method getDefaultMigratingTransitionInstanceValidators.

public List<MigratingTransitionInstanceValidator> getDefaultMigratingTransitionInstanceValidators() {
    List<MigratingTransitionInstanceValidator> migratingTransitionInstanceValidators = new ArrayList<MigratingTransitionInstanceValidator>();
    migratingTransitionInstanceValidators.add(new NoUnmappedLeafInstanceValidator());
    migratingTransitionInstanceValidators.add(new AsyncAfterMigrationValidator());
    migratingTransitionInstanceValidators.add(new AsyncProcessStartMigrationValidator());
    migratingTransitionInstanceValidators.add(new AsyncMigrationValidator());
    return migratingTransitionInstanceValidators;
}
Also used : AsyncProcessStartMigrationValidator(org.camunda.bpm.engine.impl.migration.validation.instance.AsyncProcessStartMigrationValidator) AsyncMigrationValidator(org.camunda.bpm.engine.impl.migration.validation.instance.AsyncMigrationValidator) MigratingTransitionInstanceValidator(org.camunda.bpm.engine.impl.migration.validation.instance.MigratingTransitionInstanceValidator) AsyncAfterMigrationValidator(org.camunda.bpm.engine.impl.migration.validation.instance.AsyncAfterMigrationValidator) ArrayList(java.util.ArrayList) NoUnmappedLeafInstanceValidator(org.camunda.bpm.engine.impl.migration.validation.instance.NoUnmappedLeafInstanceValidator)

Example 2 with MigratingTransitionInstanceValidator

use of org.camunda.bpm.engine.impl.migration.validation.instance.MigratingTransitionInstanceValidator in project camunda-bpm-platform by camunda.

the class MigrateProcessInstanceCmd method validateInstructions.

protected void validateInstructions(CommandContext commandContext, MigratingProcessInstance migratingProcessInstance, MigratingProcessInstanceValidationReportImpl processInstanceReport) {
    List<MigratingActivityInstanceValidator> migratingActivityInstanceValidators = commandContext.getProcessEngineConfiguration().getMigratingActivityInstanceValidators();
    List<MigratingTransitionInstanceValidator> migratingTransitionInstanceValidators = commandContext.getProcessEngineConfiguration().getMigratingTransitionInstanceValidators();
    List<MigratingCompensationInstanceValidator> migratingCompensationInstanceValidators = commandContext.getProcessEngineConfiguration().getMigratingCompensationInstanceValidators();
    Map<MigratingActivityInstance, MigratingActivityInstanceValidationReportImpl> instanceReports = new HashMap<MigratingActivityInstance, MigratingActivityInstanceValidationReportImpl>();
    for (MigratingActivityInstance migratingActivityInstance : migratingProcessInstance.getMigratingActivityInstances()) {
        MigratingActivityInstanceValidationReportImpl instanceReport = validateActivityInstance(migratingActivityInstance, migratingProcessInstance, migratingActivityInstanceValidators);
        instanceReports.put(migratingActivityInstance, instanceReport);
    }
    for (MigratingEventScopeInstance migratingEventScopeInstance : migratingProcessInstance.getMigratingEventScopeInstances()) {
        MigratingActivityInstance ancestorInstance = migratingEventScopeInstance.getClosestAncestorActivityInstance();
        validateEventScopeInstance(migratingEventScopeInstance, migratingProcessInstance, migratingCompensationInstanceValidators, instanceReports.get(ancestorInstance));
    }
    for (MigratingCompensationEventSubscriptionInstance migratingEventSubscriptionInstance : migratingProcessInstance.getMigratingCompensationSubscriptionInstances()) {
        MigratingActivityInstance ancestorInstance = migratingEventSubscriptionInstance.getClosestAncestorActivityInstance();
        validateCompensateSubscriptionInstance(migratingEventSubscriptionInstance, migratingProcessInstance, migratingCompensationInstanceValidators, instanceReports.get(ancestorInstance));
    }
    for (MigratingActivityInstanceValidationReportImpl instanceReport : instanceReports.values()) {
        if (instanceReport.hasFailures()) {
            processInstanceReport.addActivityInstanceReport(instanceReport);
        }
    }
    for (MigratingTransitionInstance migratingTransitionInstance : migratingProcessInstance.getMigratingTransitionInstances()) {
        MigratingTransitionInstanceValidationReportImpl instanceReport = validateTransitionInstance(migratingTransitionInstance, migratingProcessInstance, migratingTransitionInstanceValidators);
        if (instanceReport.hasFailures()) {
            processInstanceReport.addTransitionInstanceReport(instanceReport);
        }
    }
}
Also used : MigratingTransitionInstanceValidator(org.camunda.bpm.engine.impl.migration.validation.instance.MigratingTransitionInstanceValidator) MigratingCompensationEventSubscriptionInstance(org.camunda.bpm.engine.impl.migration.instance.MigratingCompensationEventSubscriptionInstance) MigratingActivityInstanceValidationReportImpl(org.camunda.bpm.engine.impl.migration.validation.instance.MigratingActivityInstanceValidationReportImpl) HashMap(java.util.HashMap) MigratingActivityInstance(org.camunda.bpm.engine.impl.migration.instance.MigratingActivityInstance) MigratingEventScopeInstance(org.camunda.bpm.engine.impl.migration.instance.MigratingEventScopeInstance) MigratingTransitionInstanceValidationReportImpl(org.camunda.bpm.engine.impl.migration.validation.instance.MigratingTransitionInstanceValidationReportImpl) MigratingTransitionInstance(org.camunda.bpm.engine.impl.migration.instance.MigratingTransitionInstance) MigratingCompensationInstanceValidator(org.camunda.bpm.engine.impl.migration.validation.instance.MigratingCompensationInstanceValidator) MigratingActivityInstanceValidator(org.camunda.bpm.engine.impl.migration.validation.instance.MigratingActivityInstanceValidator)

Aggregations

MigratingTransitionInstanceValidator (org.camunda.bpm.engine.impl.migration.validation.instance.MigratingTransitionInstanceValidator)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 MigratingActivityInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingActivityInstance)1 MigratingCompensationEventSubscriptionInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingCompensationEventSubscriptionInstance)1 MigratingEventScopeInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingEventScopeInstance)1 MigratingTransitionInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingTransitionInstance)1 AsyncAfterMigrationValidator (org.camunda.bpm.engine.impl.migration.validation.instance.AsyncAfterMigrationValidator)1 AsyncMigrationValidator (org.camunda.bpm.engine.impl.migration.validation.instance.AsyncMigrationValidator)1 AsyncProcessStartMigrationValidator (org.camunda.bpm.engine.impl.migration.validation.instance.AsyncProcessStartMigrationValidator)1 MigratingActivityInstanceValidationReportImpl (org.camunda.bpm.engine.impl.migration.validation.instance.MigratingActivityInstanceValidationReportImpl)1 MigratingActivityInstanceValidator (org.camunda.bpm.engine.impl.migration.validation.instance.MigratingActivityInstanceValidator)1 MigratingCompensationInstanceValidator (org.camunda.bpm.engine.impl.migration.validation.instance.MigratingCompensationInstanceValidator)1 MigratingTransitionInstanceValidationReportImpl (org.camunda.bpm.engine.impl.migration.validation.instance.MigratingTransitionInstanceValidationReportImpl)1 NoUnmappedLeafInstanceValidator (org.camunda.bpm.engine.impl.migration.validation.instance.NoUnmappedLeafInstanceValidator)1