The graphical editor dedicated to the StateMachine Diagram has been specified from the UML 2.0 Superstructure Specification document. Feel free to bring your own remarks about the way UML concepts were represented in this diagram : we could discuss about that on the user mailing list .
1. Creation of the diagram
1.1. From the wizard
You can use the creation wizard to create a new statemachine diagram. Select the corresponding Template to initialize the model.
The root element of the UML model is a Model and it contains a Package that also contains a StateMachine as its child elements. The diagram is then linked with the StateMachine.
Then, you can notice that a " Region " model object has been created into the StateMachine : indeed, the States that are later created will be necessarily added into a Region. When a StateMachine contains only one Region, it does not appear graphically (it is the whole editing area in fact).
1.2. From an existing diagram
The statemachine diagram is necessarily associated with a StateMachine model object.
Then you can create a new diagram by selecting a StateMachine node in the Outline : "
" and select " ".Do not forget to add a first " Region " to the newly created StateMachine before trying to add elements in the diagram. Use the "Region" tool in the Palette, and then click on the diagram area.
2. Editing of the Diagram
2.1. Basic editing
2.1.1. StateMachine
A state machine is used to express the behaviour of part of a system. Behaviour is modelled as a traversal of a graph of state nodes interconnected by one or more joined transition arcs that are triggered by the dispatching of series of (event) occurrences. During this traversal, the state machine executes a series of activities associated with various elements of the state machine.
2.1.2. Region
A Region is an orthogonal part of either a composite state or a state machine. This is the model object that will be the container for the States and Transitions.
Adding a new Region : to add a new Region , select the 'Region' creation tool in the palette and then click on the header of the diagram . At the moment, the size occupied by each Region is not changeable. Each Region that is created will have the same dimensions as the others.
Deleting a Region will delete all the model objects that were contained inside. To delete a Region, use the "Delete" command available in the Outline View. When a Region is deleted, the remaining regions in the diagram are extended to fill completely the parent object including them.
2.1.3. State, CompositeState and SubmachineState
A State models a situation during which some (usually implicit) invariant condition holds. The following kinds of states are distinguished :
How is defined the type of a State ?
The graphical representation of a State is completely based on the configuration of its model object. Indeed, all elements have the same type in the model (State) and there is no explicit property used to define the kind of the State. For example, when a State contains a Region, this is a Composite State ... otherwise just a Simple State. So you must be very careful while modifying the model from the outline : we advise you to not adding(removing) a Region to(from) a State directly in the outline, it would cause a changing of its kind, but the graphical node will not reflect this change.
2.1.4. ConnectionPointReference
The notion of ConnectionPointReference is still confused for me at the moment ... :-/
2.1.5. FinalState
A special kind of state signifying that the enclosing region is completed. If the enclosing region is directly contained in a state machine and all other regions in the state machine also are completed, then it means that the entire state machine is completed.
2.1.6. PseudoState
A pseudostate is an abstraction that encompasses one of the 10 different types of transient vertices in the state machine graph :
2.1.7. Transition
A Transition is a directed relationship between a source Vertex (State or PseudoState) and a target Vertex. The graphical connection has a Label associated which represents the name of the Transition model object.
2.2. Advanced editing
2.2.1. Splitting editing area into multiple Regions
You can create as many Regions as you want in a StateMachine or in a CompositeState. By default a Region is created when you create a new diagram from the creation wizard or when you create a CompositeState from the Palette creation tool.
The StateMachine arranges its Regions horizontally, whereas a CompositeState arranges them vertically and those Region areas are not resizable. Later, it should be possible to change the layout, and to modify their size.
<< New in 0.11.0 >> : you can now customize the orientation of the Regions contained by a CompositeState. In the Properties View, under the "Graphics" tab, you have a checkbox called "Vertical Regions Layout" that is used to manage that. Currently it is only possible to change the layout but not the size of each Region.
2.2.2. Submachine State particularities
When you create a submachine State, you necessarily need to specify StateMachine.
Then, you can double click on the element to navigate to the diagram associated with the referenced StateMachine. If the diagram does not exist yet, you will be able to create it.
3. Diagram Example
_______________________________________
By Jacques LESCOT, Anyware Technologies
August, 31 2006