Class WorkflowConfigurer
- All Implemented Interfaces:
ApplicationConfigurer
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:
PayloadReducerRegistryFutureResolver- discovered through theServiceLoader, falling back to aDefaultTimeoutFutureResolverEventNameCustomizer- defaulting to aDefaultEventNameCustomizerClock- defaulting toClockUtils.get()- A decorator wrapping the registered
TagResolverwith aWorkflowEventTagResolver - A declarative event-sourced entity module for
EventSourcedWorkflowState ExecuteStepActionResolver- defaulting to aDefaultExecuteStepActionResolverWorkflowScheduler- defaulting to aDefaultWorkflowScheduler- A declarative event-sourced entity module for
EventSourcedRunningWorkflows - A named
ExecutorServicefor workflow-body work and workflow-event publication (seeWorkflowConfigurationDefaults.WORKFLOW_ENGINE_EXECUTOR), defaulting to a virtual-thread-per-task executor WorkflowStore- defaulting to anEventSourcedWorkflowStoreWorkflowMethodParameterResolverFactory, so handler methods can inject the current workflow context, status, and other helpful information
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 Summary
Modifier and TypeMethodDescriptionbuild()Returns the completely initializedConfigurationinstance of typeCbuilt using thisConfigurerimplementation.componentRegistry(Consumer<ComponentRegistry> componentRegistrar) Executes the givencomponentRegistraron the component registry associated with thisApplicationConfigurer.static WorkflowConfigurercreate()Creates a new configurer with the defaults required by the Workflow Engine.static WorkflowConfigurerenhance(EventSourcingConfigurer eventSourcingConfigurer) Creates aWorkflowConfigurerthat enhances an existingEventSourcingConfigurer.eventSourcing(Consumer<EventSourcingConfigurer> configurerTask) Delegates the givenconfigurerTaskto theEventSourcingConfigurerthisEventSourcingConfigurerdelegates.lifecycleRegistry(Consumer<LifecycleRegistry> lifecycleRegistrar) Executes the givenlifecycleRegistraron the lifecycle registry associated with thisApplicationConfigurer.registerWorkflowModule(WorkflowModule<?> workflowModule) Registers a workflow module.start()Builds the configurationand starts it immediately, by invokingAxonConfiguration.start().
-
Method Details
-
enhance
Creates aWorkflowConfigurerthat enhances an existingEventSourcingConfigurer.This method is useful when applying multiple specialized Configurers to configure a single application.
- Parameters:
eventSourcingConfigurer- theEventSourcingConfigurerto enhance with configuration of messaging components- Returns:
- the current instance of the
Configurerfor a fluent API - See Also:
-
create
Creates a new configurer with the defaults required by the Workflow Engine.- Returns:
- configurer
-
registerWorkflowModule
Registers a workflow module.- Parameters:
workflowModule- workflow module to register.- Returns:
- this configurer.
-
eventSourcing
Delegates the givenconfigurerTaskto theEventSourcingConfigurerthisEventSourcingConfigurerdelegates.Use this operation to invoke registration methods that only exist on the
EventSourcingConfigurer.- Parameters:
configurerTask- Lambda consuming the delegateEventSourcingConfigurer.- Returns:
- The current instance of the
Configurerfor a fluent API.
-
componentRegistry
Description copied from interface:ApplicationConfigurerExecutes the givencomponentRegistraron the component registry associated with thisApplicationConfigurer.- Specified by:
componentRegistryin interfaceApplicationConfigurer- Parameters:
componentRegistrar- The actions to take on the component registry.- Returns:
- This
ApplicationConfigurerfor a fluent API.
-
lifecycleRegistry
Description copied from interface:ApplicationConfigurerExecutes the givenlifecycleRegistraron the lifecycle registry associated with thisApplicationConfigurer.- Specified by:
lifecycleRegistryin interfaceApplicationConfigurer- Parameters:
lifecycleRegistrar- The actions to take on the lifecycle registry.- Returns:
- This
ApplicationConfigurerfor a fluent API.
-
start
Description copied from interface:ApplicationConfigurerBuilds the configurationand starts it immediately, by invokingAxonConfiguration.start().It is not recommended to change any configuration on
this ApplicationConfigureronce this method is called.- Specified by:
startin interfaceApplicationConfigurer- Returns:
- The fully initialized and started
AxonConfiguration.
-
build
Description copied from interface:ApplicationConfigurerReturns the completely initializedConfigurationinstance of typeCbuilt using thisConfigurerimplementation.It is not recommended to change any configuration on
this ApplicationConfigureronce this method is called.- Specified by:
buildin interfaceApplicationConfigurer- Returns:
- The fully initialized
Configurationinstance of typeC.
-