UML Modeling Techniques > Dynamic modeling > State diagrams > Checking your state diagrams (system simulation)
Checking your state diagrams (system simulation)
In Modeler, right-click the State Diagram, and select Report > Consistency.
The report is generated to the Output pane, and it lists errors and warnings:
Errors indicate that ACS for C, C++ or Java may fail to produce working code from the State Diagram.
Warnings indicate that the code produced by ACS for C, C++ or Java may not work as expected.
Rectify the problems that are causing the errors and warnings, and then repeat the consistency checks.
When you are satisfied that the State Diagrams are defined correctly, you can generate code for them through ACS.
Modeler makes the following checks:
Composite State Checks
Contains at least one Simple, Sequential or Concurrent substate (C30010).
Contains not more than one Initial State (C30011).
Contains not more than one History State of type deep history (C30012).
Contains not more than one History State of type shallow history (C30013).
Compartment States do not own Event Action Blocks (C30074)
Concurrent State Checks
Each concurrent compartment except the one entered must have an Initial State (C30063).
Initial State Checks
The State Diagram must have at least one Initial State (C30071). If a State Diagram has multiple Initial States, a warning is given.
Must have at least one outgoing transition to a State in either the same region or a sub-region (C30016).
When an Initial State has multiple outgoing Transitions, each Transition must have a Guard Condition (C30019)
When an Initial State has multiple outgoing Transitions, one Transition should use the 'else' keyword to ensure that there is always a valid Transition (C30020).
When an Initial State has an outgoing Transition, it must have no trigger (C30023).
Event Action Block Checks
If the Trigger Type is Signal, the Even Action Block must be associated with an Event (C30073).
If the Trigger Type is Call, the Even Action Block must be associated with an Operation (C30072).
Final State Checks
When contained by a Sequential or Concurrent State, the Sequential or Concurrent State must have an outgoing Transition whose Trigger Type is <none> (C30028).
The source State of a Transition triggered by a completion trigger must be a Sequential or Concurrent State that contains a Final State (C30032).
Incoming transitions must be from states in the same region, or a sub-region only (C30025).
History State Checks
A History State must have at least one incoming transition (C30095).
Outgoing transitions are to States in the same region (C30031).
If the History State has incoming transitions from Initial States, it must have an outgoing Transition (C30032)
An outgoing transition from a history state must not have a trigger or guard condition (C30058).
Fork State Checks
A Fork State must have at least one incoming Transition and two or more outgoing Transitions (C30076)
Each outgoing Transition is to a State in a different concurrent region or to a Synch State owned by the parent Concurrent State (C30036).
Each outgoing Transition has no Guard Condition (C30042).
Each outgoing Transition is to a Simple, Sequential or Concurrent State (C30040).
Join State Checks
A Fork State must have at least one outgoing Transition and two or more incoming Transitions (C30075)
Each incoming Transition is from a State in a different concurrent region of the Concurrent State, or from a Synch State owned by the parent Concurrent State (C30037).
Each incoming Transition has no Guard Condition and a Trigger Type of <none> (C30043).
Each incoming Transition is from a Simple, Sequential or Concurrent State (C30041).
Junction State Checks
Has at least one incoming transition and one outgoing transition (C30054).
Outgoing Transitions must not be Triggered by a Call, Signal, Time or Change Trigger type (C30055).
When a Junction State has multiple outgoing Transitions, each Transition has a Guard Condition (C30056).
Transitions between Junctions do not form a cycle without passing through a Simple, Sequential or Concurrent State (C30057).
Transition Checks
When a Transition uses the Guard Condition 'Else', at least one other Transition must originate from its source object (C30060).
When a Transition uses the Guard Condition 'Else', no other Transitions from its source object must use the Guard Condition 'Else' (C30059).
When a Transition goes to the boundary of a Sequential State, that State must contain an Initial State (C30061).
When a Transition goes to an Atomic State that is the parent of a State Diagram, that State's State Diagram must contain an Initial State (C30061).
When a Transition goes to the boundary of a Concurrent State, each region of that State must contain an Initial State (C30062).
When a Transition goes from one Concurrent region to another Concurrent region, the Concurrent regions other than the target region of the Transition must contain an Initial State (C30063).
Other Checks
Classes being generated do not have a super-class that defines a state machine.
Each State in the machine appears on at least one of its State Diagrams.