Class WorkflowValidator.Builder

  • All Implemented Interfaces:
    org.apache.commons.lang3.builder.Builder<IWorkflowValidator>
    Enclosing class:
    WorkflowValidator

    public static class WorkflowValidator.Builder
    extends Object
    implements org.apache.commons.lang3.builder.Builder<IWorkflowValidator>
    Builder for creating a WorkflowValidator. Only a project is required, there are defaults for all other settings.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • Builder

        public Builder​(Mandant client,
                       Projekt project,
                       WorkflowVersion workflowVersion)
                throws NullPointerException
        Parameters:
        client - The client who owns the project and workflow version to validate. Must not be null.
        project - The project of the workflow to validate. Must not be null.
        workflowVersion - The workflow version to validate. Must not be null.
        Throws:
        NullPointerException - When the given client, project, or workflow version is null.
    • Method Detail

      • client

        public WorkflowValidator.Builder client​(Mandant client)
        Parameters:
        client - The client to use for validation. If not given, defaults to the client of the project.
        Returns:
        this for chaining.
      • clockProvider

        public WorkflowValidator.Builder clockProvider​(javax.validation.ClockProvider clockProvider)
        Parameters:
        clockProvider - The clock provider to use for obtaining the current time. If not given, defaults to the default system clock.
        Returns:
        this for chaining.
      • ec

        public WorkflowValidator.Builder ec​(IEntityContext ec)
        Parameters:
        ec - The entity context to use for database transactions. If not given, a new entity context is created when the workflow is validated.
        Returns:
        this for chaining.
      • exclude

        public WorkflowValidator.Builder exclude​(Set<ElementKey> keys)
        Add the given keys to the set of workflow element that will not be validated. When deciding whether to validate a workflow element, the algorithm proceeds as follows:
        1. input (workflowElement)
        2. set key := workflowElement.key
        3. set included := (includes is empty) or (includes contains key)
        4. set excluded := (excludes contains key)
        5. output (included and not excluded)
        Parameters:
        keys - A set workflow elements that are exempt from validation.
        Returns:
        this for chaining.
      • flowAnalysis

        public void flowAnalysis​(WorkflowFlowAnalysis flowAnalysis)
        Parameters:
        flowAnalysis - Flow analysis to reuse. When not given or null, creates a new flow analysis for the process or task.
      • include

        public WorkflowValidator.Builder include​(Set<ElementKey> keys)
        Add the given elements to the set of workflow element that will be validated. When deciding whether to validate a workflow element, the algorithm proceeds as follows:
        1. input (workflowElement)
        2. set key := workflowElement.key
        3. set included := (includes is empty) or (includes contains key)
        4. set excluded := (excludes contains key)
        5. output (included and not excluded)
        Parameters:
        keys - A set of workflow elements to validate.
        Returns:
        this for chaining.
      • locale

        public WorkflowValidator.Builder locale​(Locale locale)
        Parameters:
        locale - The locale to use for validation. If not given, defaults to the default FORMCYCLE locale.
        Returns:
        this for chaining.
      • messageTemplate

        public WorkflowValidator.Builder messageTemplate​(String messageTemplate)
        Parameters:
        messageTemplate - The message to use as a template for the validation constraint message and the label. Defaults to {0}: {1}. Usually the value of javax.faces.validator.BeanValidator.MESSAGE.
        Returns:
        this for chaining.
      • provider

        public WorkflowValidator.Builder provider​(IWorkflowProvider provider)
        Parameters:
        provider - Workflow provider to use during validation. When not given, a new default provider is created.
        Returns:
        this for chaining.
      • user

        public WorkflowValidator.Builder user​(Benutzer user)
        Parameters:
        user - The user who initiated the workflow validation process. If not given, defaults to an anonymous user.
        Returns:
        this for chaining.
      • validatorFactory

        public WorkflowValidator.Builder validatorFactory​(javax.validation.ValidatorFactory validatorFactory)
        Parameters:
        validatorFactory - Validator factory to use. When not set, the default validator factory is used.
        Returns:
        this for chaining.