Given two instances of a StateMachine<S, E> resulting from the same StateMachineFactory<S, E> and a StateMachineListener<S, E>, I can listen for state changes and uniquely identify the state by its id, regardless of the state machine instance:
@Override
stateEntered(State<S, E> state) {
S id = state.getId();
// "state" is a different object depending on the state machine instance
// "id" is the same in different state machine instances
}
For transitions, this is not possible:
@Override
public void transition(Transition<S, E> transition) {
// "transition" is a different object depending on the state machine instance
// there is no "id" available
}
In the current implementation I did not find a way to uniquely identify the Transition across StateMachine instances. In UML, transitions can be identified by name. Consequently, I implemented named transitions as a solution for above use case.
JIRA
There is no related issue in JIRA (as to my knowledge).
Use case
Given two instances of a
StateMachine<S, E>
resulting from the sameStateMachineFactory<S, E>
and aStateMachineListener<S, E>
, I can listen for state changes and uniquely identify the state by its id, regardless of the state machine instance:For transitions, this is not possible:
In the current implementation I did not find a way to uniquely identify the
Transition
acrossStateMachine
instances. In UML, transitions can be identified by name. Consequently, I implemented named transitions as a solution for above use case.JIRA
There is no related issue in JIRA (as to my knowledge).
CLA
Yes, I have signed the CLA.