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 Details

    • withInitialTransition

      WorkflowDefinitionBuilder withInitialTransition(Consumer<TransitionBuilder> transition)
      Adds an initial transition to the workflow definition.
      Parameters:
      transition - consumer to configure the transition
      Returns:
      this builder for method chaining
    • withoutInitialTransition

      WorkflowDefinitionBuilder withoutInitialTransition(TransitionId transitionId)
      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 modify
      transition - consumer to configure the modified transition
      Returns:
      this builder for method chaining
    • withCommonTransition

      WorkflowDefinitionBuilder withCommonTransition(Consumer<TransitionBuilder> transition)
      Adds a common transition to the workflow definition.
      Parameters:
      transition - consumer to configure the transition
      Returns:
      this builder for method chaining
    • withoutCommonTransition

      WorkflowDefinitionBuilder withoutCommonTransition(TransitionId transitionId)
      Removes a common transition from the workflow definition.
      Parameters:
      transitionId - the ID of the transition to remove
      Returns:
      this builder for method chaining
    • withGlobalTransition

      WorkflowDefinitionBuilder withGlobalTransition(Consumer<TransitionBuilder> transition)
      Adds a global transition to the workflow definition.
      Parameters:
      transition - consumer to configure the transition
      Returns:
      this builder for method chaining
    • withExtensions

      WorkflowDefinitionBuilder withExtensions(ExtensionProvider extensionProvider)
      Configures the workflow definition with an extension provider.
      Parameters:
      extensionProvider - the extension provider to use
      Returns:
      this builder for method chaining
    • withProperties

      WorkflowDefinitionBuilder withProperties(Properties properties)
      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

      WorkflowDefinitionBuilder withoutState(StateId stateId)
      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 modify
      state - 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

      WorkflowDefinitionBuilder withoutFork(ForkId forkId)
      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 modify
      fork - 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 modify
      join - consumer to configure the modified join
      Returns:
      this builder for method chaining
    • withoutJoin

      WorkflowDefinitionBuilder withoutJoin(JoinId joinId)
      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 conditions
      conditions - consumer to configure the conditions
      Returns:
      this builder for method chaining
    • define

      static WorkflowDefinitionBuilder define(WorkflowDefinitionId workflowDefinitionId)
      Creates a new WorkflowDefinitionBuilder with the specified workflow definition ID.
      Parameters:
      workflowDefinitionId - the ID for the workflow definition
      Returns:
      a new WorkflowDefinitionBuilder instance
    • define

      static WorkflowDefinitionBuilder define()
      Creates a new WorkflowDefinitionBuilder with a randomly generated workflow definition ID.
      Returns:
      a new WorkflowDefinitionBuilder instance
    • withName

      WorkflowDefinitionBuilder withName(String workflowName)
      Sets the name of the workflow definition.
      Parameters:
      workflowName - the name of the workflow
      Returns:
      this builder for method chaining
    • build

      Builds the WorkflowDefinition instance with all configured properties.
      Returns:
      a new WorkflowDefinition instance
    • withId

      WorkflowDefinitionBuilder withId(WorkflowDefinitionId workflowDefinitionId)
      Sets the ID of the workflow definition.
      Parameters:
      workflowDefinitionId - the ID for the workflow definition
      Returns:
      this builder for method chaining