Nested States

The Nested States pattern describes a Class or other element that has a number of States one or more of which themselves have states (sub states). The pattern allows these states to be displayed on the same diagram.

Figure 1. A State Machine diagram showing nested states in one of the states.
Discussion
The purpose is to allow Software Engineers and other Stakeholders to create a visual representation of two (or more) levels of State transitions on a single diagram. 

This representation is often useful when conducting a walk-through of the transitions to understand the owning element's behavior or when placing the nested states on the same diagram makes it easier to understand the transitions between states without the need to click through to a composite diagram.

1.	Rename the States and Transitions in the diagram to suit your initiative.
New States and other elements and connectors can be dragged onto the diagram from the Toolbox or the Project Browser.

The following is a list of some of the next steps available when applying the pattern.
·	Create an executable State Machine from the diagram.
Show how States in this State Machine interact with States in other State Machine constructed for other elements in the model.

Useful Workspace Layouts Core | Core Modeling
Reference
The following help topics will assist you learn about how to work with this pattern.
State Machines
Working with Diagrams
Changing Element Appearance
Changing Diagram Layout

The following tools are useful when working with this pattern.
Specification View
The Specification View can be used as a way of working with the Components and Interfaces particularly when there are a large number of elements as is typically the case when describing a system of any appreciable size. For more details see the Specification View help topic.
Hand Drawn and Whiteboard Diagrams
The Hand Drawn and Whiteboard Mode are display options available for any diagram that changes a system-drawn diagram to appear as though it was drawn by hand and, optionally, hand drawn on a whiteboard. It is a powerful device to engage an audience by presenting the diagram in a rough and more immediate style giving the impression that it is just a sketch that can be changed. For more details see the Hand Drawn and Whiteboard Mode help topic.
Alternate and Images for Diagram Elements
Most standard elements allow an alternate image to be defined for an element that will be used in place of the graphical notation for the element either on a selected diagram or as a default on all diagrams. For more details see the Using the Image Manager help topic.
Compiled Simulator
The Compiled Simulator provides a number of facilities for working with Executable State Machines. This includes generating the state models to a variety of programming language code, building and running a simulation. Analyzer Scripts can be configured that determine how code is generated, compiled and executed for the Executable State Machine. The generated code can be viewed and edited using the built-in code editor and the execution analyzer can be used to debug running code. For more details see the Using the Compiled Simulation Panel help topic.
Element Discussions
The Element Discussion facility is a fully featured collaboration tool allowing modelers and model viewers and reviewers to communicate with each other directly inside the repository. Modelers using the full client or occasional viewers using WebEA can both post and reply to discussions and communicate and engage in chat. For more details see the Element Discussions help topic.
Pan and Zoom
The Pan and Zoom facility is one of the tools that can be used to navigate around a large diagram. Often the resolution of a diagram must be reduced to ensure it is wholly visible but by using the Pan and Zoom window you can leave the diagram at a readable resolution and pan around to areas of interest zooming in when necessary. For more details see the Pan and Zoom help topic.
Diagram Legends
The Diagram Legend facility is useful for manually or automatically changing the appearance of elements and connectors on a diagram. A legend can be added from the Common Toolbox and configured to codify the fill and line color and line thickness. This is a powerful way to add meaning and expression to a diagram and is particularly expressive when applied automatically based on element or connector properties. It can be used with a number of specialized diagrams such as roadmaps to create a powerful visualization.  For more details see the Diagram Legends help topic.
Document Generator
The Document Generator is a powerful facility in Enterprise Architect that allows a Database Engineer or other stakeholder to create high quality corporate or technical documentation directly from the model, suitable for internal or external audiences. For more details see the Documentation help topic.

© 2000 - 2018  Sparx Systems Pty Ltd.  All rights Reserved.