spring-statemachine

what is different with Transitions external internal and local ? in Spring doc 11.5 Configuring Transitions


11.5 Configuring Transitions We support three different types of transitions, external, internal and local. Transitions are either triggered by a signal which is an event sent into a state machine or a timer. I donot konw what is different .


Solution

  • Internal

    You can think of internal transition as self-transition - from A to A; Source and target state are always the same.

    Local and External

    Most of the time these two are equivalent, with the exception of when transitioning between super and sub-states. Local transition doesn’t cause exit and entry to source state if target state is a substate of a source state or if the target is a superstate of a source state.

    Please consult the official UML specification (section 14.5.11 - Transition class, especially - Constraints section, where the above is formally defined) upon which the Spring state machine is implemented.