Interface EventNameCustomizer

All Known Implementing Classes:
DefaultEventNameCustomizer

public interface EventNameCustomizer
Customizes workflow event names.
Since:
5.4.0
Author:
Simon Zambrovski, Stefan Dragisic
  • 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 step
      parameters - the parameters associated with the step
      stepStatus - 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 step
      parameters - the parameters associated with the step
      stepStatus - 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 by ctx.migrateVersion(changeId, newVersion). The changeId is 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) with StepStatus.COMPLETED and appends a .Versioned marker 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).

      invalid reference
      DefaultEventNameCustomizer
      overrides this with the canonical <changeId>.Versioned form; 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.