Class ValidationHelper


  • public class ValidationHelper
    extends Object
    UI helper utilities for running the workflow validator and extracting and converting workflow validation messages.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • performBackgroundValidation

        public static void performBackgroundValidation​(FlowchartModel flowchartModel,
                                                       AssociatesModel associatesModel,
                                                       WorkflowValidationModel validationModel,
                                                       IWorkflowProvider provider)
                                                throws FastJsonException
        Validate the current workflow in the background while the user is editing the workflow. This provides incremental feedback to the user. Once they attempt to save the workflow, a full validation is performed.
        Parameters:
        flowchartModel - Current flowchart model.
        validationModel - Current validation model.
        associatesModel - Current associates model.
        provider - Workflow provider to use.
        Throws:
        FastJsonException - When serialized element properties could not be deserialized.
      • performFullValidation

        public static IWorkflowValidationResult performFullValidation​(WorkflowProcess process,
                                                                      FlowchartModel flowchartModel,
                                                                      WorkflowValidationModel validationModel,
                                                                      ViewSettingsModel viewSettingsModel,
                                                                      IWorkflowProvider provider)
                                                               throws FastJsonException
        Performs a full validation of the workflow and validates all elements. Adds the validation messages to the flowchart. Also shows any invalid workflow elements that are hidden so the user can see the error.
        Parameters:
        process - Workflow process to validate.
        flowchartModel - Current flowchart model.
        validationModel - Current validation model.
        viewSettingsModel - Current view settings model,
        provider - Workflow provider to use. Can be null for a new database provider.
        Returns:
        The result of the validation.
        Throws:
        FastJsonException - When serialized element properties could not be deserialized.
      • performInitialValidation

        public static void performInitialValidation​(IWorkflowValidationEnvironmentData params,
                                                    IWorkflowProvider provider,
                                                    FlowchartModel flowchartModel,
                                                    WorkflowProcess process,
                                                    WorkflowValidationModel validationModel)
        Performs the initial full validation when the workflow designer is opened.
        Parameters:
        params - Params for the validation process.
        provider - Provider to use. When not given, a new database provider is created.
        flowchartModel - Flowchart model to validate.
        process - Process to validate.
        validationModel - Current UI validation messages model.