Previous | UML Classes | Table of Contents | UML Packages | Next |
• RedefinableElement (from Kernel ) on page 132
A region is an orthogonal part of either a composite state or a state machine. It contains states and transitions.
Attributes
No additional attributes
Associations
Issue 8411 - add subsets constraints and change format to fit document conventions
• statemachine: StateMachine[0..1] The StateMachine that owns the Region . If a Region is owned by a StateMachine, then it cannot also be owned by a State. {Subsets NamedElement ::namespace}
• state: State[0..1] The State that owns the Region . If a Region is owned by a State, then it cannot also be owned by a StateMachine. {Subsets NamedElement ::namespace}
• transition:Transition[*] The set of transitions owned by the region. Note that internal transitions are owned by a region, but applies to the source state. {Subsets Namespace ::ownedMember}
• subvertex: Vertex [*] The set of vertices that are owned by this region. {Subsets Namespace ::ownedMember}
Issue 8411- add redefinition and subsets constraints 9092 - add subsets constraint
• extendedRegion : Region [0..1] The region of which this region is an extension. {Subsets RedefinableElement ::redefinedElement}
• /redefinitionContext: Classifier[1] References the classifier in which context this element may be redefined. {Redefines RedefinableElement ::redefinitionContext}
Constraints
[1] A region can have at most one initial vertex.
self.subvertex->select (v | v.oclIsKindOf(Pseudostate))->
select(p : Pseudostate | p.kind = #initial)->size() <= 1
[2] A region can have at most one deep history vertex.
self.subvertex->select (v | v.oclIsKindOf(Pseudostate))->select(p : Pseudostate | p.kind = #deepHistory)->size() <= 1
[3] A region can have at most one shallow history vertex.
self.subvertex->select(v | v.oclIsKindOf(Pseudostate))->select(p : Pseudostate | p.kind = #shallowHistory)->size() <= 1
[4] If a Region is owned by a StateMachine, then it cannot also be owned by a State and vice versa.
(stateMachine->notEmpty() implies state->isEmpty()) and (state->notEmpty() implies stateMachine->isEmpty())
[5] The redefinition context of a region is the nearest containing statemachine.
redefinitionContext = let sm = containingStateMachine() inif sm.context->isEmpty() or sm.general->notEmpty() then
smelsesm.contextendif
Additional constraints
Issue 8411 - change capitalization of ‘stateMachine’
[1] The query isRedefinitionContextValid() specifies whether the redefinition contexts of a region are properly related
to the redefinition contexts of the specified region to allow this element to redefine the other. The containing StateMachine/State
of a redefining region must redefine the containing StateMachine/State of the redefined region.
[2] The query isConsistentWith() specifies that a redefining region is consistent with a redefined region provided that the
redefining region is an extension of the redefined region (i.e., it adds vertices and transitions and it redefines states
and transitions of the redefined region).
Additional operations
Issue 8411 - change capitalization of ‘stateMachine’
[1] The operation containingStatemachine() returns the StateMachine in which this Region is defined.
context Region ::containingStatemachine() : StateMachine
post: result = if stateMachine->isEmpty() then state.containingStateMachine()
else stateMachine
Semantics
The semantics of regions is tightly coupled with states or state machines having regions, and it is therefore defined as part
of the semantics for state and state machine.
When a composite state or state machine is extended, each inherited region may be extended, and regions may be added.
Notation
A composite state or state machine with regions is shown by tiling the graph region of the state/state machine using dashed
lines to divide it into regions. Each region may have an optional name and contains the nested disjoint states and the transitions
between these. The text compartments of the entire state are separated from the orthogonal regions by a solid line.
A composite state or state machine with just one region is shown by showing a nested state diagram within the graph region.
In order to indicate that an inherited region is extended, the keyword «extended» is associated with the name of the region.