Font size

Statechart declaration rules

When you draw statechart elements in the graphical editor, AnyLogic analyzes the resulting structure and automatically constructs statecharts. But you may make some mistakes while defining statecharts that must be corrected. For instance, the standalone incomplete fragments (just state, just transition, etc.) cause errors because there is no way to distinguish what particular statechart they belong to.

In the Projects view erroneously defined statechart elements are placed into the Statecharts tree branch:

Follow the rules below when drawing statecharts.
  1. Each statechart should have exactly one statechart entry point.
  2. Each composite state should have exactly one initial state pointer.
  3. Each statechart element (state, transition, etc.) should belong to some statechart, i.e. transition should connect some states or pseudo states of the statechart, state should be connected with a statechart. The situations when one end of the transition is "hanging" in the air or state is not connected to is an error.
How can we improve this article?