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 have final state (ERROR) which hasn't any transitions or specific actions. Should I describe it anyway in empty state<TaskStateType.ERROR> branch?
Now I miss it so I receive
java.lang.IllegalStateException: Missing definition for state Error!
because Error is absent in graph.stateDefinitions and com.tinder.StateMachine#notifyOnEnter method fails with such exception.
My state machine definition:
StateMachine.create<TaskStateType, StateEventType, TaskStateHandler> {
initialState(TaskStateType.New)
state<TaskStateType.New> {
on<StateEventType.OnWait> {
dontTransition()
}
on<StateEventType.OnError> {
transitionTo(TaskStateType.Error, handlerFactory.findHandlerByEvent(EventType.ERROR))
}
}
// TaskStateType.Error is missed here
onTransition {
val transition = it as? StateMachine.Transition.Valid
transition.sideEffect?.handle(context)
}
}
It looks pretty ugly. May be I define something wrong so I need your help :-)
The text was updated successfully, but these errors were encountered:
ranetkaSt
changed the title
java.lang.IllegalStateException if StateMachine doesn't contain description of End state
java.lang.IllegalStateException if StateMachine doesn't contain description of toState
Jan 12, 2023
I have final state (ERROR) which hasn't any transitions or specific actions. Should I describe it anyway in empty
state<TaskStateType.ERROR>
branch?Now I miss it so I receive
because Error is absent in
graph.stateDefinitions
andcom.tinder.StateMachine#notifyOnEnter
method fails with such exception.My state machine definition:
Need I change it to:
It looks pretty ugly. May be I define something wrong so I need your help :-)
The text was updated successfully, but these errors were encountered: