-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal transitions in nested state seems to trigger multiple actions #63
Comments
@hekailiang I'm willing to contribute with a patch for this issue. Since I'm unfamiliar with code at the moment, could you provide any hints for me to get started? |
go head, pass all the unit test |
@hekailiang any hints on where I should start looking? |
@hekailiang Was able to find the problem. This line here https://github.com/hekailiang/squirrel/blob/master/squirrel-foundation/src/main/java/org/squirrelframework/foundation/fsm/impl/StateImpl.java#L390 can create duplicate transitions in the sub-state. In the following example from debugger we clearly see two duplicate COLLECTING sub-states: I'm planning to avoiding duplication of entries here: https://github.com/hekailiang/squirrel/blob/master/squirrel-foundation/src/main/java/org/squirrelframework/foundation/fsm/impl/StateMachineDataImpl.java#L174
Does this seem correct to you? Test suite is passing and this solves my issue. |
Created PR |
Hi,
I've started to use Squirrel recently to build an FSM for some media operations as defined here. So far, the framework seems to have a lot of nice features and is pretty flexible. Great job!
I think I came across a bug though. To implement the PlayCollect feature, I need Play and Collect states to execute in parallel. Like this:
This is how the FSM is setup:
The problem I came across is related to internal state transition in nested states. Like PROMPTING -> Prompting on NEXT_TRACK. It seems to trigger more actions than intended.
Here is a simple test case:
You can find the complete log here squirrel-internal-transition-bug.txt.
It seems more actions are triggered the greater the number of local transitions we have.
Can you please look into this and confirm it's a bug?
Thanks in advance!
The text was updated successfully, but these errors were encountered: