Interface WorkflowDefinitionBuilderProvider


public interface WorkflowDefinitionBuilderProvider
Provider interface for creating WorkflowDefinitionBuilder instances. This interface allows for pluggable implementations of workflow definition builders and supports both programmatic registration and service loader discovery.

The provider pattern allows for different implementations of workflow builders to be used without changing the client code. Implementations can be registered programmatically or discovered through the Java ServiceLoader mechanism.

Since:
1.0
See Also:
  • Method Details

    • createWorkflowBuilder

      WorkflowDefinitionBuilder createWorkflowBuilder(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
    • createWorkflowBuilder

      default WorkflowDefinitionBuilder createWorkflowBuilder()
      Creates a new WorkflowDefinitionBuilder with a randomly generated workflow definition ID.
      Returns:
      a new WorkflowDefinitionBuilder instance
    • registerProvider

      static void registerProvider(WorkflowDefinitionBuilderProvider provider)
      Registers a provider instance programmatically. This method allows for explicit provider registration without relying on the service loader mechanism.
      Parameters:
      provider - the provider instance to register
      Throws:
      NullPointerException - if the provider is null
    • provider

      Gets the current provider instance. This method first checks for a programmatically registered provider, then falls back to service loader discovery.
      Returns:
      the current provider instance
      Throws:
      IllegalStateException - if no provider is found through either mechanism