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

StateHandler not invoked #4

Open
vishalg0wda opened this issue Jan 31, 2018 · 1 comment
Open

StateHandler not invoked #4

vishalg0wda opened this issue Jan 31, 2018 · 1 comment

Comments

@vishalg0wda
Copy link

vishalg0wda commented Jan 31, 2018

StateHandler does not get invoked if defined with primitive datatypes:

@StateHandler(state = STATE_LOCATION_RESOLUTION_REQUIRED)
public void onEventStateLocationResolutionRequired(boolean success, TinyMachine tm) {
    // Code does not flow here.
    if (success) tm.transitionTo(STATE_BINDING_SERVICE);
    else tm.transitionTo(STATE_FAILED_LOCATION_RESOLUTION);
}

...

mTinyMachine.transitionTo(STATE_LOCATION_RESOLUTION_REQUIRED);
mTinyMachine.fireEvent(true);

This is probably not a bug, but I believe it should be mentioned in the docs. Would definitely save someone else the time.

Aside: thank you for this wonderful library! We're using it extensively in our app. :)

@igala
Copy link

igala commented Feb 26, 2018

Few more features would be great to have:

  • Allowed transitions support, meaning to block transitions to new state which are not allowed
  • Undo: support undoing last tranisitions

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