Skip to content

Make LifeCycleEvents constants switchable again - #1815

Merged
fjtirado merged 1 commit into
open-workflow-specification:mainfrom
fjtirado:Allow_switch
Oct 30, 2026
Merged

fjtirado merged 1 commit into
open-workflow-specification:mainfrom
fjtirado:Allow_switch

Conversation

@fjtirado

Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing the public fullEventType(String) overload breaks source and binary compatibility for existing clients, so it must be retained alongside the new enum overload.

1 open issue
What changed in this PR

Restores compile-time constants in LifecycleEvents so SDK consumers can use them in Java switch labels while preserving existing event strings.

Changes:

  • Extracts literal prefixes and event suffixes into nested Constants classes.
  • Uses those literals to initialize LifecycleEvents constants.
  • Changes event-type formatting to accept EventType and updates publisher calls.
File Description
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​LifecycleEvents.java Uses constant expressions for switch-compatible event names.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​lifecycle/​LifeCycleEventType.java Exposes prefix constants and changes the formatting method parameter.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​lifecycle/​EventType.java Extracts event suffix constants and adjusts string formatting.
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​lifecycle/​ce/​AbstractLifeCyclePublisher.java Passes enum values directly to the formatting method.

Review effort: Balanced

Comment on lines +33 to 35
public String fullEventType(EventType eventType) {
return prefix + eventType.type();
}
@fjtirado
fjtirado merged commit 5c51b95 into open-workflow-specification:main Oct 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants