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
I'm creating workflow execution using the stateless FSM behind the scene. In the execution I need to keep track of number of transitions, and halt the execution if that count is ever exceeded, in order to prevent runaway situations.
I have a struct to keep track of number of transitions happened in the FSM:
type ResetOperation struct {
fsm *stateless.StateMachine
transitionCount int32
}
To increment transitionCount I'm using OnTransitioning() handler. However, there seems to be no way to return error from the handler function, and calling fsm.Deactive() will not stop the execution.
I could probably fire trigger "maxTransitionsReached" and have an error state in the FSM, but if I understand correctly, firing the trigger will cause it to be put on queue fireModeQueued, and queue might not be empty.
What is proper way to handle this scenario?
The text was updated successfully, but these errors were encountered:
I'm creating workflow execution using the stateless FSM behind the scene. In the execution I need to keep track of number of transitions, and halt the execution if that count is ever exceeded, in order to prevent runaway situations.
I have a struct to keep track of number of transitions happened in the FSM:
To increment transitionCount I'm using
OnTransitioning()
handler. However, there seems to be no way to return error from the handler function, and callingfsm.Deactive()
will not stop the execution.I could probably fire trigger "maxTransitionsReached" and have an error state in the FSM, but if I understand correctly, firing the trigger will cause it to be put on queue
fireModeQueued
, and queue might not be empty.What is proper way to handle this scenario?
The text was updated successfully, but these errors were encountered: