State with History

The State with History pattern creates elements and a diagram that describes how a State can include a History Pseudostate that remembers the current state when the parent state is exited and subsequently returned.

Figure 1. State Machine diagram showing a Composite State that includes a History Pseudostate.
Discussion
The purpose is to allow a modeler to express that a State Machine is able to remember a parent State's active state at the time it is exited and then to resume at that State when the Parent State is reentered. 

It is typically used in situations where the execution of a State Machine is interrupted due to an event. The machine remembers (keeps a history) of the active state immediately prior to transitioning from the parent state and then when the machine transitions back to the parent state the remembered state becomes active.

The following is a list of some things you may want to do when working with this pattern.
·	Change the name of the diagram and elements to suit the initiative.
Create additional States and Transitions to suit the initiative.
Change the Target of the Transition exiting from the History Psuedostate.

The following is a list of some of the next steps available when applying the pattern.
·	Change the History Pseudostate to a Deep history if required.
Consider creating an executable state machine to view a compiled simulation.

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
History
Simulation with History Pseudostate
Working with Diagrams
Changing Element Appearance
Changing Diagram Layout

The following are some of the tools that will be helpful when working with this pattern.
Diagram Layout
The Diagram Layout tool allows you to layout an entire diagram, selected elements or sections of a diagram to make it more visually appealing or meaningful to a particular audience. There are a wide range of layout types to choose from and some types have filters that can be applied. For more details see the Diagram Layout 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.
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.
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.

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