Interface WorkflowDefinitionBuilder
public interface WorkflowDefinitionBuilder
Builder interface for creating and configuring WorkflowDefinition instances. This builder
provides a fluent API for defining complete workflow definitions including states, transitions,
forks, joins, and other workflow elements.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the WorkflowDefinition instance with all configured properties.static WorkflowDefinitionBuilderdefine()Creates a new WorkflowDefinitionBuilder with a randomly generated workflow definition ID.static WorkflowDefinitionBuilderdefine(WorkflowDefinitionId workflowDefinitionId) Creates a new WorkflowDefinitionBuilder with the specified workflow definition ID.modifyFork(ForkId forkId, Consumer<BuildableForkBuilder> fork) Modifies an existing fork in the workflow definition.modifyInitialTransition(TransitionId transitionId, Consumer<BuildableTransitionBuilder> transition) Modifies an existing initial transition in the workflow definition.modifyJoin(JoinId joinId, Consumer<BuildableJoinBuilder> join) Modifies an existing join in the workflow definition.modifyState(StateId stateId, Consumer<BuildableStateBuilder> state) Modifies an existing state in the workflow definition.withCommonTransition(Consumer<TransitionBuilder> transition) Adds a common transition to the workflow definition.withExtensions(ExtensionProvider extensionProvider) Configures the workflow definition with an extension provider.withFork(Consumer<ForkBuilder> fork) Adds a fork to the workflow definition.withGlobalCondition(Conditions.Operator operator, Consumer<ConditionsBuilder> conditions) Adds global conditions to the workflow definition.withGlobalTransition(Consumer<TransitionBuilder> transition) Adds a global transition to the workflow definition.withId(WorkflowDefinitionId workflowDefinitionId) Sets the ID of the workflow definition.withInitialTransition(Consumer<TransitionBuilder> transition) Adds an initial transition to the workflow definition.withJoin(Consumer<JoinBuilder> join) Adds a join to the workflow definition.Sets the name of the workflow definition.withoutCommonTransition(TransitionId transitionId) Removes a common transition from the workflow definition.withoutFork(ForkId forkId) Removes a fork from the workflow definition.withoutInitialTransition(TransitionId transitionId) Removes an initial transition from the workflow definition.withoutJoin(JoinId joinId) Removes a join from the workflow definition.withoutState(StateId stateId) Removes a state from the workflow definition.withProperties(Properties properties) Configures the workflow definition with properties.withState(Consumer<StateBuilder> state) Adds a state to the workflow definition.
-
Method Details
-
withInitialTransition
Adds an initial transition to the workflow definition.- Parameters:
transition- consumer to configure the transition- Returns:
- this builder for method chaining
-
withoutInitialTransition
Removes an initial transition from the workflow definition.- Parameters:
transitionId- the ID of the transition to remove- Returns:
- this builder for method chaining
-
modifyInitialTransition
WorkflowDefinitionBuilder modifyInitialTransition(TransitionId transitionId, Consumer<BuildableTransitionBuilder> transition) Modifies an existing initial transition in the workflow definition.- Parameters:
transitionId- the ID of the transition to modifytransition- consumer to configure the modified transition- Returns:
- this builder for method chaining
-
withCommonTransition
Adds a common transition to the workflow definition.- Parameters:
transition- consumer to configure the transition- Returns:
- this builder for method chaining
-
withoutCommonTransition
Removes a common transition from the workflow definition.- Parameters:
transitionId- the ID of the transition to remove- Returns:
- this builder for method chaining
-
withGlobalTransition
Adds a global transition to the workflow definition.- Parameters:
transition- consumer to configure the transition- Returns:
- this builder for method chaining
-
withExtensions
Configures the workflow definition with an extension provider.- Parameters:
extensionProvider- the extension provider to use- Returns:
- this builder for method chaining
-
withProperties
Configures the workflow definition with properties.- Parameters:
properties- the properties to configure- Returns:
- this builder for method chaining
-
withState
Adds a state to the workflow definition.- Parameters:
state- consumer to configure the state- Returns:
- this builder for method chaining
-
withoutState
Removes a state from the workflow definition.- Parameters:
stateId- the ID of the state to remove- Returns:
- this builder for method chaining
-
modifyState
Modifies an existing state in the workflow definition.- Parameters:
stateId- the ID of the state to modifystate- consumer to configure the modified state- Returns:
- this builder for method chaining
-
withFork
Adds a fork to the workflow definition.- Parameters:
fork- consumer to configure the fork- Returns:
- this builder for method chaining
-
withoutFork
Removes a fork from the workflow definition.- Parameters:
forkId- the ID of the fork to remove- Returns:
- this builder for method chaining
-
modifyFork
Modifies an existing fork in the workflow definition.- Parameters:
forkId- the ID of the fork to modifyfork- consumer to configure the modified fork- Returns:
- this builder for method chaining
-
withJoin
Adds a join to the workflow definition.- Parameters:
join- consumer to configure the join- Returns:
- this builder for method chaining
-
modifyJoin
Modifies an existing join in the workflow definition.- Parameters:
joinId- the ID of the join to modifyjoin- consumer to configure the modified join- Returns:
- this builder for method chaining
-
withoutJoin
Removes a join from the workflow definition.- Parameters:
joinId- the ID of the join to remove- Returns:
- this builder for method chaining
-
withGlobalCondition
WorkflowDefinitionBuilder withGlobalCondition(Conditions.Operator operator, Consumer<ConditionsBuilder> conditions) Adds global conditions to the workflow definition.- Parameters:
operator- the operator for combining conditionsconditions- consumer to configure the conditions- Returns:
- this builder for method chaining
-
define
Creates a new WorkflowDefinitionBuilder with the specified workflow definition ID.- Parameters:
workflowDefinitionId- the ID for the workflow definition- Returns:
- a new WorkflowDefinitionBuilder instance
-
define
Creates a new WorkflowDefinitionBuilder with a randomly generated workflow definition ID.- Returns:
- a new WorkflowDefinitionBuilder instance
-
withName
Sets the name of the workflow definition.- Parameters:
workflowName- the name of the workflow- Returns:
- this builder for method chaining
-
build
WorkflowDefinition build()Builds the WorkflowDefinition instance with all configured properties.- Returns:
- a new WorkflowDefinition instance
-
withId
Sets the ID of the workflow definition.- Parameters:
workflowDefinitionId- the ID for the workflow definition- Returns:
- this builder for method chaining
-