State with Regions

The State with Regions pattern creates elements and a diagram that contains an orthogonal composite State that contains two regions each containing a number of Substates. The regions are indicated by compartments separated by a dotted line. When the composite state is transitioned to each region will have its own independent state and both regions will have its own active State.

Figure 1. Shows a State Machine diagram where one State has two Regions defined.
Discussion
The purpose of the pattern is to provide a mechanism that allows two or more regions that contain sets of States to be modeled within an owning state. This allows the analyst to model concurrent States within a State Machine or composite State.

It is typically used in situations where a State Machine or Composite State exhibits the behavior of having two or more concurrently active states.  

The following is a list of some things you may want to do when working with this pattern.
·	Change the name of the diagram States and Regions to suit the initiative.
Change the name of the Triggers, Guards and Events defined for each Transition.
Change the name of the Entry, Do and Exit actions defined within each State.
Add other Regions as required for the initiative.

The following is a list of some of the next steps available when applying the pattern.
·	Consider creating an executable State machine to allow programming code to be automatically generated for the State Machine.
Add detailed notes that describe the business or system significance of the State changes including the Regions.

Useful Workspace Layouts Core | Core Modeling, Wide View
Reference
The following help topics will assist you learn about how to work with this pattern.
State Machines
Regions
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.
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.

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.
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 or the more general topic on Model Publishing.

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