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

entry-actions should fire after transition action #4

Open
jiangts opened this issue Jan 1, 2017 · 1 comment
Open

entry-actions should fire after transition action #4

jiangts opened this issue Jan 1, 2017 · 1 comment

Comments

@jiangts
Copy link

jiangts commented Jan 1, 2017

Suppose you're given the following configuration

{
:states {:fsm/A {:entry-actions [[:fsm/action1]]
                 :exit-actions [[:fsm/action2]]}}
:transitions {[:fsm/A :event] {:target :fsm/A
                               :actions [[:fsm/action3]]}}
...
}

When the transition :event is fired on state :fsm/A, the expected order of actions dispatched should be
action2, action3, action1. In the given implementation, the order is action2, action1, action3.

@jiangts jiangts changed the title entry-actions should fire after action entry-actions should fire after transition action Jan 1, 2017
@nodename
Copy link
Owner

nodename commented Jan 1, 2017

I don't agree. The transition is supposed to conceptually take zero time; in other words, the system is not in a valid state if you access it between states, and there is no context in which an action can take place.
I believe it is standard for the transition action to take place in the context of the target state, although it would be valid (but not equivalent) if the other choice (context of the source state) were made consistently throughout.

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