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 aWorkflowValidator
. Only a project is required, there are defaults for all other settings.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description Builder(Mandant client, Projekt project, WorkflowVersion workflowVersion)
Builder(Projekt project)
Builder(WorkflowVersion workflowVersion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IWorkflowValidator
build()
WorkflowValidator.Builder
client(Mandant client)
WorkflowValidator.Builder
clockProvider(javax.validation.ClockProvider clockProvider)
WorkflowValidator.Builder
ec(IEntityContext ec)
WorkflowValidator.Builder
exclude(Set<ElementKey> keys)
Add the given keys to the set of workflow element that will not be validated.void
flowAnalysis(WorkflowFlowAnalysis flowAnalysis)
WorkflowValidator.Builder
include(Set<ElementKey> keys)
Add the given elements to the set of workflow element that will be validated.WorkflowValidator.Builder
locale(Locale locale)
WorkflowValidator.Builder
messageTemplate(String messageTemplate)
WorkflowValidator.Builder
provider(IWorkflowProvider provider)
WorkflowValidator.Builder
user(Benutzer user)
WorkflowValidator.Builder
validatorFactory(javax.validation.ValidatorFactory validatorFactory)
-
-
-
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 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
public Builder(Projekt project) throws NullPointerException
- Parameters:
project
- The project of the workflow to validate. Must not benull
.- Throws:
NullPointerException
- When the given project isnull
.
-
Builder
public Builder(WorkflowVersion workflowVersion) throws NullPointerException
- Parameters:
workflowVersion
- The workflow version to validate. Must not benull
.- Throws:
NullPointerException
- When the given workflow version isnull
.
-
-
Method Detail
-
build
public IWorkflowValidator build()
- Specified by:
build
in interfaceorg.apache.commons.lang3.builder.Builder<IWorkflowValidator>
-
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:- 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
public void flowAnalysis(WorkflowFlowAnalysis flowAnalysis)
- Parameters:
flowAnalysis
- Flow analysis to reuse. When not given ornull
, 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:- 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
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 ofjavax.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.
-
-