Class WorkflowCompleteEvent
- All Implemented Interfaces:
WorkflowTerminationEvent, HumanReadable, JobEvent, Serializable
Published by the job dispatcher when the root job of a workflow finishes. This is the definitive signal for the UI to stop spinners, show results, or display errors. Only published for root jobs - sub-job completions/failures are internal to the workflow.
Implements both WorkflowTerminationEvent (triggers observer self-cleanup)
and HumanReadable (a workflow-scoped observer forwards it to the person watching).
Distinct from MessageCompleteEvent which signals completion of a single
message exchange within a long-lived chat session.
Carries the outcome and the reason, which is also its message; the one-argument form is
a success reading Workflow completed successfully. A success answers
COMPLETING under the title Workflow Complete, a failure FAILING
under Workflow Failed.
- Since:
- 0.1 (2025-10-11)
- Author:
- Andrey Santrosyan
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionWorkflowCompleteEvent(JobSnapshot snapshot) Creates a successful workflow complete event.WorkflowCompleteEvent(JobSnapshot snapshot, boolean successful, String reason) Creates a workflow complete event. -
Method Summary
Modifier and TypeMethodDescriptionReturns a plain-text message suitable for display to end users.The reason for workflow termination: one of the two questions every member of this category answers.booleanWhether the workflow completed successfully: the other question every member of this category answers.jobState()msgType()title()Methods inherited from class AbstractJobEvent
message, setMessage, snapshot, timestamp
-
Constructor Details
-
WorkflowCompleteEvent
Creates a workflow complete event.- Parameters:
snapshot- the root job's snapshotsuccessful- whether the workflow completed successfullyreason- description of the outcome
-
WorkflowCompleteEvent
Creates a successful workflow complete event.- Parameters:
snapshot- the root job's snapshot
-
-
Method Details
-
getTerminationReason
Description copied from interface:WorkflowTerminationEventThe reason for workflow termination: one of the two questions every member of this category answers.- Specified by:
getTerminationReasonin interfaceWorkflowTerminationEvent- Returns:
- a human-readable description of why the workflow terminated
-
isSuccessful
public boolean isSuccessful()Description copied from interface:WorkflowTerminationEventWhether the workflow completed successfully: the other question every member of this category answers.- Specified by:
isSuccessfulin interfaceWorkflowTerminationEvent- Returns:
- true if the workflow completed all its tasks successfully, false if it was terminated due to error or cancellation
-
msgType
-
title
-
jobState
-
getHumanMessage
Description copied from interface:HumanReadableReturns a plain-text message suitable for display to end users.- Specified by:
getHumanMessagein interfaceHumanReadable- Returns:
- user-friendly message
-
getReason
-