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:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classHolder class for the registered provider instance. -
Method Summary
Modifier and TypeMethodDescriptiondefault WorkflowDefinitionBuilderCreates a new WorkflowDefinitionBuilder with a randomly generated workflow definition ID.createWorkflowBuilder(WorkflowDefinitionId workflowDefinitionId) Creates a new WorkflowDefinitionBuilder with the specified workflow definition ID.provider()Gets the current provider instance.static voidRegisters a provider instance programmatically.
-
Method Details
-
createWorkflowBuilder
Creates a new WorkflowDefinitionBuilder with the specified workflow definition ID.- Parameters:
workflowDefinitionId- the ID for the workflow definition- Returns:
- a new WorkflowDefinitionBuilder instance
-
createWorkflowBuilder
Creates a new WorkflowDefinitionBuilder with a randomly generated workflow definition ID.- Returns:
- a new WorkflowDefinitionBuilder instance
-
registerProvider
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
-