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

Preconditions, PostConditions, transitions, onEntry, onExit #20

Open
theathibm opened this issue Dec 20, 2016 · 6 comments
Open

Preconditions, PostConditions, transitions, onEntry, onExit #20

theathibm opened this issue Dec 20, 2016 · 6 comments

Comments

@theathibm
Copy link

Preconditions are handled using "beforeEvent"
Postconditions are handled using "afterEvent"

State support enterState and leaveState where appropriate state logic occurs
I think there needs to support for "doTansition" where the transition logic would occur.

Thoughts?

@maxekman
Copy link
Member

Not sure what you want to do in "doTransition". Can you provide an example?

@theathibm
Copy link
Author

BeforeEvent gives and opportunity to write guards to protect the event from occurring.
AfterEvent gives the opportunity to write logic to check the outcome

DoTransition, perhaps should be called "DoEvent" and should leverage the callback mechanism. Adding one additional callback to support "doEvent" would be good.

@maxekman
Copy link
Member

Now I understand! If you want you are more than welcome to submit a PR so we can discuss it further.

@theathibm
Copy link
Author

ok, I'll modify my copy of fsm.go and put that functionality into it. Then I'll create a pull request once I get the basics in place

@maxekman
Copy link
Member

Sounds good!

@keeth
Copy link

keeth commented Jan 20, 2017

perhaps beforeEvent returning an error cancels the transition?

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

No branches or pull requests

3 participants