Class SimpleWorkflowConfigurationRegistry
- All Implemented Interfaces:
WorkflowConfigurationRegistry<SimpleWorkflowConfigurationRegistry>,DescribableComponent
- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.axoniq.framework.workflow.runtime.execution.WorkflowConfigurationRegistry
WorkflowConfigurationRegistry.PredicatedWorkflowConfiguration, WorkflowConfigurationRegistry.RoutingLog -
Field Summary
Fields inherited from interface io.axoniq.framework.workflow.runtime.execution.WorkflowConfigurationRegistry
RESOURCE_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddescribeTo(ComponentDescriptor descriptor) Describe the properties ofthis DescribableComponentwith the givendescriptor.Returns the configurations registered for the given eventtypewhoseWorkflowConfiguration.workflowVersion()is the highest among all registrations (semver-ordered).getHighestVersionConfigurations(QualifiedName qualifiedName) Returns the configurations registered forqualifiedNamewhoseWorkflowConfiguration.workflowVersion()is the highest among all registrations (semver-ordered).getWorkflowsConfigurations(QualifiedName qualifiedName) register(EventCondition eventCondition, WorkflowConfiguration<?> workflowConfiguration) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.axoniq.framework.workflow.runtime.execution.WorkflowConfigurationRegistry
findByWorkflowNameAndVersion, findClosestHigherRegisteredVersion, findClosestRegisteredVersion, getByVersion, getWorkflowConfiguration, register, registeredVersions, resolveDefinitionForReplay, warnAboutSameVersionDuplicates
-
Constructor Details
-
SimpleWorkflowConfigurationRegistry
public SimpleWorkflowConfigurationRegistry()
-
-
Method Details
-
register
public SimpleWorkflowConfigurationRegistry register(EventCondition eventCondition, WorkflowConfiguration<?> workflowConfiguration) - Specified by:
registerin interfaceWorkflowConfigurationRegistry<SimpleWorkflowConfigurationRegistry>
-
getHighestVersionConfigurations
public List<WorkflowConfigurationRegistry.PredicatedWorkflowConfiguration> getHighestVersionConfigurations(MessageType type) Returns the configurations registered for the given eventtypewhoseWorkflowConfiguration.workflowVersion()is the highest among all registrations (semver-ordered). Multiple configurations may be returned if duplicates exist at that version (run-in-parallel semantics).This is the lookup event-driven callers use, so the event's type reaches the registry whole. It is currently decided on
MessageType.qualifiedName()alone, and taking the full type keepsMessageType.version()in reach for when it participates in the decision.The memoized lookup is keyed by
MessageType.qualifiedName(), as the event's version does not select a configuration yet. Taking the whole type here keepsMessageType.version()in reach of the lookup for when it does.- Specified by:
getHighestVersionConfigurationsin interfaceWorkflowConfigurationRegistry<SimpleWorkflowConfigurationRegistry>
-
getHighestVersionConfigurations
public List<WorkflowConfigurationRegistry.PredicatedWorkflowConfiguration> getHighestVersionConfigurations(QualifiedName qualifiedName) Description copied from interface:WorkflowConfigurationRegistryReturns the configurations registered forqualifiedNamewhoseWorkflowConfiguration.workflowVersion()is the highest among all registrations (semver-ordered). Multiple configurations may be returned if duplicates exist at that version (run-in-parallel semantics).Event-driven callers should use
WorkflowConfigurationRegistry.getHighestVersionConfigurations(MessageType); this variant serves registration-time recomputation, where only aQualifiedNameexists.- Specified by:
getHighestVersionConfigurationsin interfaceWorkflowConfigurationRegistry<SimpleWorkflowConfigurationRegistry>
-
supportedEvents
- Specified by:
supportedEventsin interfaceWorkflowConfigurationRegistry<SimpleWorkflowConfigurationRegistry>
-
getWorkflowsConfigurations
public List<WorkflowConfigurationRegistry.PredicatedWorkflowConfiguration> getWorkflowsConfigurations(QualifiedName qualifiedName) - Specified by:
getWorkflowsConfigurationsin interfaceWorkflowConfigurationRegistry<SimpleWorkflowConfigurationRegistry>
-
describeTo
Description copied from interface:DescribableComponentDescribe the properties ofthis DescribableComponentwith the givendescriptor.Components should call the appropriate
describePropertymethods on the descriptor to register their properties. The descriptor is responsible for determining how these properties are formatted and structured in the final output.Best Practices: As a general rule, all relevant fields of a
DescribableComponentimplementation should be described in this method. However, developers have discretion to include only the fields that make sense in the context. Not every field may be meaningful for description purposes, especially internal implementation details. Furthermore, components might want to expose different information based on their current state. The final decision on what properties to include lies with the person implementing thedescribeTomethod, who should focus on providing information that is useful for understanding the component's configuration and state.Example implementation:
public void describeTo(ComponentDescriptor descriptor) { descriptor.describeProperty("name", this.name); descriptor.describeProperty("enabled", this.enabled); descriptor.describeProperty("configuration", this.configuration); // A nested component descriptor.describeProperty("handlers", this.eventHandlers); // A collection }- Specified by:
describeToin interfaceDescribableComponent- Parameters:
descriptor- The component descriptor to describethis DescribableComponentn its properties in.
-