Class WorkflowValidator.Builder
java.lang.Object
de.xima.fc.workflow.processor.engine.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 Summary
ConstructorsConstructorDescriptionBuilder
(Mandant client, Projekt project, WorkflowVersion workflowVersion) Builder
(WorkflowVersion workflowVersion) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
clockProvider
(javax.validation.ClockProvider clockProvider) ec
(IEntityContext ec) exclude
(Set<ElementKey> keys) Add the given keys to the set of workflow element that will not be validated.void
flowAnalysis
(WorkflowFlowAnalysis flowAnalysis) include
(Set<ElementKey> keys) Add the given elements to the set of workflow element that will be validated.messageTemplate
(String messageTemplate) provider
(IWorkflowProvider provider) Deprecated.validatorFactory
(javax.validation.ValidatorFactory validatorFactory)
-
Constructor Details
-
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 benull
.project
- The project of the workflow to validate. Must not benull
.workflowVersion
- The workflow version to validate. Must not benull
.- Throws:
NullPointerException
- When the given client, project, or workflow version isnull
.
-
Builder
- Parameters:
project
- The project of the workflow to validate. Must not benull
.- Throws:
NullPointerException
- When the given project isnull
.
-
Builder
- Parameters:
workflowVersion
- The workflow version to validate. Must not benull
.- Throws:
NullPointerException
- When the given workflow version isnull
.
-
-
Method Details
-
build
- Specified by:
build
in interfaceorg.apache.commons.lang3.builder.Builder<IWorkflowValidator>
-
client
- Parameters:
client
- The client to use for validation. If not given, defaults to the client of the project.- Returns:
- this for chaining.
-
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
- 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
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:- input (workflowElement)
- set key := workflowElement.key
- set included := (includes is empty) or (includes contains key)
- set excluded := (excludes contains key)
- output (included and not excluded)
- Parameters:
keys
- A set workflow elements that are exempt from validation.- Returns:
- this for chaining.
-
flowAnalysis
- Parameters:
flowAnalysis
- Flow analysis to reuse. When not given ornull
, creates a new flow analysis for the process or task.
-
include
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:- input (workflowElement)
- set key := workflowElement.key
- set included := (includes is empty) or (includes contains key)
- set excluded := (excludes contains key)
- output (included and not excluded)
- Parameters:
keys
- A set of workflow elements to validate.- Returns:
- this for chaining.
-
locale
- Parameters:
locale
- The locale to use for validation. If not given, defaults to the default formcycle locale.- Returns:
- this for chaining.
-
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 ofjavax.faces.validator.BeanValidator.MESSAGE
.- Returns:
- this for chaining.
-
provider
- Parameters:
provider
- Workflow provider to use during validation. When not given, a new default provider is created.- Returns:
- this for chaining.
-
user
Deprecated.Useuser(IUser)
instead.- Parameters:
user
- The user who initiated the workflow validation process. If not given, defaults to an anonymous user.- Returns:
- this for chaining.
-
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.
-
user(IUser)
instead.