Search in sources :

Example 1 with Validator

use of org.activiti.validation.validator.Validator in project Activiti by Activiti.

the class ProcessValidatorImpl method validate.

@Override
public List<ValidationError> validate(BpmnModel bpmnModel) {
    List<ValidationError> allErrors = new ArrayList<ValidationError>();
    for (ValidatorSet validatorSet : validatorSets) {
        for (Validator validator : validatorSet.getValidators()) {
            List<ValidationError> validatorErrors = new ArrayList<ValidationError>();
            validator.validate(bpmnModel, validatorErrors);
            if (!validatorErrors.isEmpty()) {
                for (ValidationError error : validatorErrors) {
                    error.setValidatorSetName(validatorSet.getName());
                }
                allErrors.addAll(validatorErrors);
            }
        }
    }
    return allErrors;
}
Also used : ValidatorSet(org.activiti.validation.validator.ValidatorSet) ArrayList(java.util.ArrayList) Validator(org.activiti.validation.validator.Validator)

Aggregations

ArrayList (java.util.ArrayList)1 Validator (org.activiti.validation.validator.Validator)1 ValidatorSet (org.activiti.validation.validator.ValidatorSet)1