Merge pull request #837 from hieblmi/fsm-notif-context

fsm: add event context to notification struct
This commit is contained in:
Slyghtning 2024-10-16 20:53:13 +02:00 committed by GitHub
commit 32ab2626af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,6 +76,8 @@ type Notification struct {
NextState StateType
// Event is the event that was processed.
Event EventType
// EventContext is the event context that was processed.
EventContext EventContext
// LastActionError is the error returned by the last action executed.
LastActionError error
}
@ -222,6 +224,7 @@ func (s *StateMachine) SendEvent(event EventType, eventCtx EventContext) error {
PreviousState: s.previous,
NextState: s.current,
Event: event,
EventContext: eventCtx,
LastActionError: s.LastActionError,
}