You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose a shared enum for lifecycle event kinds #1638
sdk-java currently models workflow/task lifecycle events as a set of concrete classes (WorkflowStartedEvent, TaskCompletedEvent, etc., in io.serverlessworkflow.impl.lifecycle) plus a separate class of CloudEvent-type string constants (LifecycleEvents). There's no single enum identifying "what kind of event is this" that consumers can switch/filter on without an instanceof chain or comparing against LifecycleEvents strings.
Downstream, at least two consumers in quarkiverse/quarkus-flow independently reimplement this same taxonomy as local enums:
opentelemetry/runtime: WorkflowEventType + TaskEventType, each pairing a constant with its LifecycleEvents id and a fromEvent(WorkflowEvent) classifier via instanceof checks.
testing (quarkus-flow-testing): EventType, a flat 16-value enum covering both workflow- and task-level events, used to classify recorded events in test assertions.
Both are hand-written mirrors of the same 16 event kinds sdk-java already defines via its event classes/LifecycleEvents constants.
Request: Expose a canonical enum (e.g. LifecycleEventType) in io.serverlessworkflow.impl.lifecycle, ideally with:
One value per concrete WorkflowEvent subtype (workflow- and task-level).
A way to classify an arbitrary WorkflowEvent instance to its LifecycleEventType (replacing the instanceof chains each consumer currently writes).
A link back to the matching LifecycleEvents CE-id constant, if practical.
This would let consumers (like Quarkus Flow's opentelemetry and testing modules) drop their local duplicates and depend on a single sdk-java-owned source of truth.
Hmmm, I have doubts about this one, I think the constant should suffice. If you check the open telemetry, the enum is used to print the constant.
In any case, enum or constant, it seems useful to have a type() method in WorkflowEvent that return the enum/constant
Activity
fjtirado commentedon Aug 31, 2026
@mcruzdev Please add the links to the qflow code, so I can recall the use case.
mathecruz commentedon Aug 31, 2026
Here is the comment to a pull request where I am adding a new enum: quarkiverse/quarkus-flow#494 (comment).
Additionally, @wmedvede added it to the openetelemetry module, see WorkflowEventType and TaskEventType.
fjtirado commentedon Aug 31, 2026
Hmmm, I have doubts about this one, I think the constant should suffice. If you check the open telemetry, the enum is used to print the constant.
In any case, enum or constant, it seems useful to have a type() method in WorkflowEvent that return the enum/constant
[Fix open-workflow-specification#1638] Implementing toString on enum
[Fix open-workflow-specification#1638] Implementing toString on enum
[Fix open-workflow-specification#1638] Implementing toString on enum
Introduce EventType enum (open-workflow-specification#1646)