Class WorkflowConfigurer

java.lang.Object
io.axoniq.framework.workflow.configuration.WorkflowConfigurer
All Implemented Interfaces:
ApplicationConfigurer

public class WorkflowConfigurer extends Object implements ApplicationConfigurer
The workflow ApplicationConfigurer of Axon Framework's configuration API.

Provides register operations for the workflow module infrastructure components.

Through WorkflowConfigurationDefaults, this configurer registers the following defaults, each only if the application has not already registered one of its own:

Every WorkflowConfigurationRegistry, WorkflowExecutionRepository, WorkflowCancellationService, MutableWorkflowHistoryRepository, and WorkflowManager is, by contrast, not among these app-wide defaults. Each WorkflowModule registers its own instance of these, named after itself, so several WorkflowModules in one application never share any of them.

To replace or decorate any of the remaining app-wide defaults above, use their respective type as the identifier.

Since:
5.4.0
Author:
Simon Zambrovski
  • Method Details

    • enhance

      public static WorkflowConfigurer enhance(EventSourcingConfigurer eventSourcingConfigurer)
      Creates a WorkflowConfigurer that enhances an existing EventSourcingConfigurer.

      This method is useful when applying multiple specialized Configurers to configure a single application.

      Parameters:
      eventSourcingConfigurer - the EventSourcingConfigurer to enhance with configuration of messaging components
      Returns:
      the current instance of the Configurer for a fluent API
      See Also:
    • create

      public static WorkflowConfigurer create()
      Creates a new configurer with the defaults required by the Workflow Engine.
      Returns:
      configurer
    • registerWorkflowModule

      public WorkflowConfigurer registerWorkflowModule(WorkflowModule<?> workflowModule)
      Registers a workflow module.
      Parameters:
      workflowModule - workflow module to register.
      Returns:
      this configurer.
    • eventSourcing

      public WorkflowConfigurer eventSourcing(Consumer<EventSourcingConfigurer> configurerTask)
      Delegates the given configurerTask to the EventSourcingConfigurer this EventSourcingConfigurer delegates.

      Use this operation to invoke registration methods that only exist on the EventSourcingConfigurer.

      Parameters:
      configurerTask - Lambda consuming the delegate EventSourcingConfigurer.
      Returns:
      The current instance of the Configurer for a fluent API.
    • componentRegistry

      public WorkflowConfigurer componentRegistry(Consumer<ComponentRegistry> componentRegistrar)
      Description copied from interface: ApplicationConfigurer
      Executes the given componentRegistrar on the component registry associated with this ApplicationConfigurer.
      Specified by:
      componentRegistry in interface ApplicationConfigurer
      Parameters:
      componentRegistrar - The actions to take on the component registry.
      Returns:
      This ApplicationConfigurer for a fluent API.
    • lifecycleRegistry

      public WorkflowConfigurer lifecycleRegistry(Consumer<LifecycleRegistry> lifecycleRegistrar)
      Description copied from interface: ApplicationConfigurer
      Executes the given lifecycleRegistrar on the lifecycle registry associated with this ApplicationConfigurer.
      Specified by:
      lifecycleRegistry in interface ApplicationConfigurer
      Parameters:
      lifecycleRegistrar - The actions to take on the lifecycle registry.
      Returns:
      This ApplicationConfigurer for a fluent API.
    • start

      public AxonConfiguration start()
      Description copied from interface: ApplicationConfigurer
      Builds the configuration and starts it immediately, by invoking AxonConfiguration.start().

      It is not recommended to change any configuration on this ApplicationConfigurer once this method is called.

      Specified by:
      start in interface ApplicationConfigurer
      Returns:
      The fully initialized and started AxonConfiguration.
    • build

      public AxonConfiguration build()
      Description copied from interface: ApplicationConfigurer
      Returns the completely initialized Configuration instance of type C built using this Configurer implementation.

      It is not recommended to change any configuration on this ApplicationConfigurer once this method is called.

      Specified by:
      build in interface ApplicationConfigurer
      Returns:
      The fully initialized Configuration instance of type C.