Contents > C: List of Design Rules > C.18 State Rules

C.18 State Rules

Rule: NoIncomingCategory: Completeness
Severity: 1-highApplies to: all areas
State has no incoming transitions.

Without incoming transitions, the state can never be reached. Add one or more transitions to the state.


Rule: NoOutgoingCategory: Completeness
Severity: 1-highApplies to: all areas
State has no outgoing transitions.

Without outgoing transitions, the state can never be left. Check if this is merely an oversight or the actually intended behavior. In the former case, add the missing outgoing transition(s). In the latter case, consider adding an outgoing transition to a final state.


Rule: IllegalJoinCategory: Correctness
Severity: 1-highApplies to: all areas
Join states must have two or more incoming and exactly one outgoing transition.
  • This is a WFR of the UML.
  • Value returned: number of incoming and outgoing transitions of the join state.


Rule: IllegalForkCategory: Correctness
Severity: 1-highApplies to: all areas
Fork states must have exactly one incoming and two or more outgoing transitions.
  • This is a WFR of the UML.
  • Value returned: number of incoming and outgoing transitions of the fork state.


Rule: IllegalChoiceCategory: Correctness
Severity: 1-highApplies to: all areas
A choice or junction state must have at least one incoming and one outgoing transition.
  • This is a WFR of the UML.
  • Value returned: number of incoming and outgoing transitions of the choice state.


Rule: MissingGuardCategory: Correctness
Severity: 1-highApplies to: all areas
If there are two or more transitions from a choice state, they all must have guards.

A choice state realizes a dynamic conditional branch; the guards are required to evaluate the branch conditions. Check the outgoing transitions and add the missing guard(s).

  • Suggested in [Amb03].
  • Value returned: name of the target state of the transition without guard.


Rule: IllegalInitialCategory: Correctness
Severity: 1-highApplies to: all areas
An initial state must have no incoming and exactly one outgoing transition.
  • This is a WFR of the UML.
  • Value returned: number of incoming and outgoing transitions of the initial state.


Rule: IllegalFinal1Category: Correctness
Severity: 1-highApplies to: all areas
A final state cannot have any outgoing transitions. Remove the outgoing transitions from the model.
  • This is a WFR of the UML.
  • Value returned: number of outgoing transitions of the final state.


Rule: IllegalFinal2Category: Correctness
Severity: 1-highApplies to: all areas
A final state cannot have any regions or entry/exit/state behavior.

Check the state and remove all regions, entry, exit, and do activities.

  • This is a WFR of the UML.
  • Value returned: number of regions and activities of the final state.


Rule: IllegalEntryExitCategory: Correctness
Severity: 1-highApplies to: all areas
Entry or exit point is not owned by a top-level region. Move the entry or exit point to the top-level region of the state machine.
  • This is a WFR of the UML.


Rule: IllegalHistoryCategory: Correctness
Severity: 1-highApplies to: all areas
The history state has two or more outgoing transitions.

A history state can have at most one outgoing transition. Check the history state and remove the surplus outgoing transitions.

  • This is a WFR of the UML.
  • Value returned: the number of outgoing transitions of the history state.


Rule: UnnamedCategory: Completeness
Severity: 3-lowApplies to: all areas
State has no name.

While the UML allows for anonymous states, adding a descriptive name to the state increases the readability and understandability of the diagram.

  • Suggested in [Amb03].
  • This rule does not check pseudo and final states. Their function is obvious, so they can be left unnamed.


Rule: BadForkOutgoingCategory: Correctness
Severity: 1-highApplies to: all areas
Transitions from fork states must not have a guard or triggers. Check the outgoing transitions and remove the guards and triggers.
  • This is a WFR of the UML.


Rule: ForkTargetStates1Category: Correctness
Severity: 1-highApplies to: all areas
Fork state has transitions to states in identical regions.

The transitions from a fork state must target states of different regions of a concurrent state. Check the outgoing transitions and make sure they all target different regions.

  • This is a WFR of the UML.


Rule: ForkTargetStates2Category: Correctness
Severity: 1-highApplies to: all areas
Fork state has transitions to states in different concurrent states.

The transitions from a fork state in a state machine must target regions of the same concurrent state. Check the outgoing transitions and make sure they all target the same concurrent state.

  • This is a WFR of the UML.


Rule: JoinSourceStates1Category: Correctness
Severity: 1-highApplies to: all areas
Join state has transitions from states in identical regions.

The transitions to a join state must originate from states of different regions of a concurrent state. Check the incoming transitions and make sure they all come from different regions.

  • This is a WFR of the UML.


Rule: JoinSourceStates2Category: Correctness
Severity: 1-highApplies to: all areas
Join state has transitions from states in different concurrent states.

The transitions to a join state in a state machine must originate from regions of the same concurrent state. Check the incoming transitions and make sure they all come from the same concurrent state.

  • This is a WFR of the UML.


Rule: BadForkTargetCategory: Correctness
Severity: 1-highApplies to: all areas
Transitions from fork states in a state machine must not target a pseudo state. Check the outgoing transitions and make sure they do not point to any pseudo states.
  • This is a WFR of the UML.


Rule: BadJoinSourceCategory: Correctness
Severity: 1-highApplies to: all areas
Transitions to join states in a state machine must not originate from a pseudo state. Check the incoming transitions and make sure they do not come from pseudo states.
  • This is a WFR of the UML.


Rule: BadIncomingCategory: Correctness
Severity: 1-highApplies to: all areas
Transitions to join states must not have triggers or guards. Check the incoming transitions and remove all triggers and guards.
  • This is a WFR of the UML.


Rule: BadOutgoingCategory: Correctness
Severity: 1-highApplies to: all areas
Transitions from pseudo states must not have any triggers. Check the outgoing transitions and remove all triggers and guards.
  • This is a WFR of the UML.


Rule: MissingTargetCategory: Correctness
Severity: 1-highApplies to: all areas
State has an outgoing transition not attached to a target state. Check the outgoing transitions of the state and attach any loose ends to the proper target states.


Rule: MissingSourceCategory: Correctness
Severity: 1-highApplies to: all areas
State has an incoming transition not attached to a source state. Check the incoming transitions of the state and attach any loose ends to the proper source states.