squirrel-foundation is a State Machine library, which provided a lightweight, easy use, type safe and programmable state machine implementation for Java.
Documentation says there is a listener @OnTransitionDecline, however I can't find anything on how to trigger transition decline.
To give some context use case I'm working on right now: running computation in another service. There are four states: SUBMITTED - submits item to another system - IN PROGRESS - checks the status of item in another system. If still in progress state is not changed, if done -DONE or if failed -FAILED. One way to model it is while in IN PROGRESS state make a request to another service, if request is in progress - deny transition (stay in same IN PROGRESS state), if ok - move to DONE, if failed - move to FAILED.
Actually in addition to unclear way how to decline transition it also seems to be not possible to move to either DONE or FAILED state.
How would you recommend to model this problem with FSM? Thanks.
Documentation says there is a listener
@OnTransitionDecline
, however I can't find anything on how to trigger transition decline.To give some context use case I'm working on right now: running computation in another service. There are four states:
SUBMITTED
- submits item to another system -IN PROGRESS
- checks the status of item in another system. If still in progress state is not changed, if done -DONE
or if failed -FAILED
. One way to model it is while inIN PROGRESS
state make a request to another service, if request is in progress - deny transition (stay in sameIN PROGRESS
state), if ok - move toDONE
, if failed - move toFAILED
. Actually in addition to unclear way how to decline transition it also seems to be not possible to move to eitherDONE
orFAILED
state.How would you recommend to model this problem with FSM? Thanks.