Skip to content
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

State not changed when a Entry method is call? #50

Closed
EasonPai opened this issue Jul 15, 2015 · 1 comment
Closed

State not changed when a Entry method is call? #50

EasonPai opened this issue Jul 15, 2015 · 1 comment

Comments

@EasonPai
Copy link

Hi Henry~

I am confused why is State not changed when an Entry method is called?
or this is an issue?

Take this test for example
https://github.com/hekailiang/squirrel/blob/master/squirrel-foundation/src/test/java/org/squirrelframework/foundation/fsm/samples/QuickStartSample.java

if I add a new line into function "ontoB"

protected void ontoB(String from, String to, FSMEvent event, Integer context) {
            System.out.println("Entry State \'"+to+"\'.");
            // a new line to get current state
           System.out.println("getCurrentState \'"+ getCurrentState() +"\'.");
}

run it and I get

Transition from 'A' to 'B' on event 'ToB' with context '10'.
Entry State 'B'.
getCurrentState 'A'.
Current state is B

Function "ontoB" called because state is entering "B", so I thought I should get state result as 'B'.
Am I misunderstanding this? or Is there an setting can alter this to what I expected?

I am using your great work in my app, thanks for making this.

@hekailiang
Copy link
Owner

Thanks for choosing squirrel state machine. State only changed when transition finished successfully which include exit original state, perform transition and enter new state. All these steps must be all executed successfully then state can be changed.

BTW, for further questions, I would suggest to post on Squirrel Forum instead of creating a issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants