Interface WorkflowTerminationEvent

All Superinterfaces:
JobEvent
All Known Implementing Classes:
WorkflowCompleteEvent

public sealed interface WorkflowTerminationEvent extends JobEvent permits WorkflowCompleteEvent
Sealed category for events signaling that an entire workflow has ended.

Parallel to LifecycleEvent rather than nested under it: workflow termination is a workflow-scope cleanup signal, not a job state transition. The root job's own JobCompletedEvent / JobFailedEvent covers persistence of the terminal job state; this category exists so workflow-scoped observers (WebSocket connections, UI spinners) can unsubscribe and clean up without waiting for an inactivity timeout. WorkflowCompleteEvent, the one permitted member, carries the outcome and the reason.

Since:
0.1 (2025-10-11)
Author:
Andrey Santrosyan
  • Method Summary

    Modifier and Type
    Method
    Description
    The reason for workflow termination: one of the two questions every member of this category answers.
    boolean
    Whether the workflow completed successfully: the other question every member of this category answers.

    Methods inherited from interface JobEvent

    message, snapshot, timestamp
  • Method Details

    • getTerminationReason

      String getTerminationReason()
      The reason for workflow termination: one of the two questions every member of this category answers.
      Returns:
      a human-readable description of why the workflow terminated
    • isSuccessful

      boolean isSuccessful()
      Whether the workflow completed successfully: the other question every member of this category answers.
      Returns:
      true if the workflow completed all its tasks successfully, false if it was terminated due to error or cancellation