Interface EventNameCustomizer
- All Known Implementing Classes:
DefaultEventNameCustomizer
public interface EventNameCustomizer
Customizes workflow event names.
- Since:
- 5.4.0
- Author:
- Simon Zambrovski, Stefan Dragisic
-
Method Summary
Modifier and TypeMethodDescriptionReturns a customized event name based on the provided step name, parameters, and workflow status.getEventName(String stepName, Map<String, @Nullable Object> parameters, StepStatus stepStatus) Returns a customized event name based on the provided step name, parameters, and step status.getEventName(String stepName, Map<String, @Nullable Object> parameters, WorkflowStatus stepStatus) Returns a customized event name based on the provided step name, parameters, and workflow status.default QualifiedNameversionMigrationEventName(String changeId, Map<String, @Nullable Object> parameters) Returns a customized event name for a migration step produced byctx.migrateVersion(changeId, newVersion).
-
Method Details
-
getEventName
QualifiedName getEventName(String stepName, Map<String, @Nullable Object> parameters, StepStatus stepStatus) Returns a customized event name based on the provided step name, parameters, and step status.- Parameters:
stepName- the name of the stepparameters- the parameters associated with the stepstepStatus- the status of the step- Returns:
- the customized event name.
-
getEventName
QualifiedName getEventName(String stepName, Map<String, @Nullable Object> parameters, WorkflowStatus stepStatus) Returns a customized event name based on the provided step name, parameters, and workflow status.- Parameters:
stepName- the name of the stepparameters- the parameters associated with the stepstepStatus- the status of the step- Returns:
- the customized event name.
-
versionMigrationEventName
default QualifiedName versionMigrationEventName(String changeId, Map<String, @Nullable Object> parameters) Returns a customized event name for a migration step produced byctx.migrateVersion(changeId, newVersion). ThechangeIdis the semantic anchor; the resulting wire-level name describes what changed (default suffix.Versioned, e.g.Payment-redesign.Versioned).The interface default derives a name from
getEventName(String, Map, StepStatus)withStepStatus.COMPLETEDand appends a.Versionedmarker so a migration event stays distinguishable on the wire from an ordinary completed-step event (which matters in an event-sourced engine — colliding names risk replay drift).overrides this with the canonicalinvalid reference
DefaultEventNameCustomizer<changeId>.Versionedform; custom customizers that do not override it still get a distinct name from this default.- Parameters:
changeId- developer-chosen identifier of the code change.parameters- parameters associated with the event.- Returns:
- the customized event name.
-
forStepInheritance
EventNameCustomizer forStepInheritance()Returns a customized event name based on the provided step name, parameters, and workflow status.- Returns:
- event name customizer that will use the namespace of the parent step.
-