hekailiang / squirrel

squirrel-foundation is a State Machine library, which provided a lightweight, easy use, type safe and programmable state machine implementation for Java.
http://hekailiang.github.io/squirrel/
Other
2.19k stars 540 forks source link

不存在的状态迁移如何处理 #111

Closed fangsh2015 closed 4 years ago

fangsh2015 commented 4 years ago

fire方法中,如果其实状态A,最终状态B,时间E,如果状态机不存在 A-B(E),那么框架怎么处理这样的异常情况。目前看,方法没有抛异常

hekailiang commented 4 years ago

你可以重载 afterTransitionDeclined 方法,或者通过@OnTransitionDecline监听相应事件