Previous UML Classes Table of Contents UML Packages Next


15.3.10 Region

BehaviorStateMachines


*Generalizations

*Description

   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

Issue 8411- add redefinition and subsets constraints 9092 - add subsets constraint

   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.

Figure 15.29 - Notation for composite state/state machine with regions

   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.