Reputation: 55
In the application that I am working on there was a state transitions defined in following manner:
transitions.
withInternal().
source(State1).
event(Event1).
action(action1()).
and().
withExternal().
source(State1).
target(State2).
event(Event1).
guard(Guard1())
In this kind of situation where both internal and external transitions are defined for the same event with same initial state , I found while debugging only action1 method getting called whenever Event1 is fired. Can there be any situation when Event1 is fired but the state transitions to State2.
Upvotes: 1
Views: 514
Reputation: 896
I believe this is a case of misconfiguration. Since your machine have two possible paths for the same source and event, how would one define where to move next?
Not sure how the framework is implemented behind the scenes, but based on your empirical knowledge, it may be a case where internal have precedence over external OR the order the configuration was done may take precedence.
Regarding your case, a possibility to move from State1 to State2 would be using event or time triggers
Upvotes: 0