Class ValidationHelper


  • @OpenApiAll
    public class ValidationHelper
    extends java.lang.Object
    Utility class for working with validation. It is able to invoke validation with given ValidationRunData or for specific Element. It is also able to open validation window and display validation results in it.
    • Constructor Detail

      • ValidationHelper

        public ValidationHelper()
    • Method Detail

      • validate

        public static java.util.Collection<RuleViolationResult> validate​(ValidationRunData validationRunData,
                                                                         @CheckForNull
                                                                         java.lang.String validationTaskName,
                                                                         @CheckForNull
                                                                         ProgressStatus progressStatus)
        Runs validation for given ValidationRunData
        Parameters:
        validationRunData - instance of ValidationRunData
        validationTaskName - which is visible when running validation. If Passed null, it will show default value "Validating"
        progressStatus - for validation, or null if to run validation with owe progress
        Returns:
        collection of validation results
      • validateElement

        public static java.util.List<RuleViolationResult> validateElement​(Element elementForValidation,
                                                                          java.util.List<Constraint> rules,
                                                                          boolean excludeReadOnly)
        Validates given element with given list of validation rules.
        Parameters:
        elementForValidation - element which should be validated
        rules - list of validation rules
        excludeReadOnly - exclude read only elements or not
        Returns:
        list of violation results
      • validateElement

        public static java.util.List<RuleViolationResult> validateElement​(Element elementForValidation,
                                                                          java.util.List<Constraint> rules,
                                                                          boolean excludeReadOnly,
                                                                          boolean recursive)
        Validates given element with given list of validation rules.
        Parameters:
        elementForValidation - element which should be validated.
        rules - list of validation rules.
        excludeReadOnly - exclude read only elements or not
        recursive - validate owned elements of given element recursively
        Returns:
        list of violation results