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
Copy file name to clipboardExpand all lines: docs/flamingock-library-config/events.md
+45-21Lines changed: 45 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,36 @@ Flamingock emits three types of events:
32
32
The Success and Failure events are mutually exclusive, only one of them will be raised for a given execution.
33
33
:::
34
34
35
+
## Event Emission Order
36
+
37
+
Events are emitted in a specific order during the Flamingock execution process:
38
+
39
+
1.**PipelineStartedEvent**: Emitted at the beginning of the pipeline execution, after validation and lock acquisition.
40
+
2.**StageStartedEvent**: Emitted for each stage before its execution begins.
41
+
3.**StageCompletedEvent** or **StageFailedEvent**: Emitted when a stage finishes successfully or fails. Only one of these will be emitted per stage.
42
+
4.**PipelineCompletedEvent** or **PipelineFailedEvent**: Emitted at the end of the pipeline execution. Only one of these will be emitted, indicating overall success or failure.
43
+
44
+
If a stage fails, both StageFailedEvent and PipelineFailedEvent will be emitted. If the pipeline completes successfully, PipelineCompletedEvent is emitted after all stages have completed.
45
+
46
+
## Event Scope
47
+
48
+
Flamingock supports events at two levels:
49
+
50
+
-**Pipeline Events**: Provide information about the entire migration process.
51
+
-**Stage Events**: Provide granular information about individual stage executions.
52
+
53
+
This allows you to monitor both high-level progress and detailed stage-by-stage execution status.
54
+
55
+
## Event Data
56
+
57
+
Events provide access to relevant information about the execution state:
58
+
59
+
-**Started Events** (`PipelineStartedEvent`, `StageStartedEvent`): These events are simple markers with no additional data.
60
+
-**Completed Events**:
61
+
-`StageCompletedEvent`: Provides access to the execution result via `getResult()`, which returns a `StageExecutor.Output` object containing the stage summary with details like the number of applied changes.
62
+
-`PipelineCompletedEvent`: A simple marker event with no additional data.
63
+
-**Failed Events** (`StageFailedEvent`, `PipelineFailedEvent`): Provide access to the exception that caused the failure via `getException()`, allowing you to inspect the error details.
64
+
35
65
## Standalone basic example
36
66
37
67
In the Flamingock builder, you must configure the events you intend to use and implement the corresponding listeners.
@@ -72,28 +102,22 @@ In the Flamingock builder, you must configure the events you intend to use and i
0 commit comments