Software Disclaimer

Class UML 2.4.1::State

Description:

A state models a situation during which some (usually implicit) invariant condition holds.The states of protocol state machines are exposed to the users of their context classifiers. A protocol state represents an exposed stable situation of its context classifier: when an instance of the classifier is not processing any operation, users of this instance can always know its state configuration.

Direct Superclasses: Namespace, RedefinableElement, Vertex

Direct Subclasses: FinalState

Class Precedence List: State, Namespace, RedefinableElement, Vertex, NamedElement, Element

Properties:

connection : ConnectionPointReference (0 *); -- source State
connectionPoint : Pseudostate (0 *); -- source State
deferrableTrigger : Trigger (0 *); -- source State
doActivity : Behavior (0 1); -- source State
entry : Behavior (0 1); -- source State
exit : Behavior (0 1); -- source State
isComposite : Boolean (1 1); -- source State
isOrthogonal : Boolean (1 1); -- source State
isSimple : Boolean (1 1); -- source State
isSubmachineState : Boolean (1 1); -- source State
redefinedState : State (0 1); -- source State
redefinitionContext : Classifier (1 1); -- source State
region : Region (0 *); -- source State
stateInvariant : Constraint (0 1); -- source State
submachine : StateMachine (0 1); -- source State
elementImport : ElementImport (0 *); -- source Namespace
importedMember : PackageableElement (0 *); -- source Namespace
member : NamedElement (0 *); -- source Namespace
ownedMember : NamedElement (0 *); -- source Namespace
ownedRule : Constraint (0 *); -- source Namespace
packageImport : PackageImport (0 *); -- source Namespace
isLeaf : Boolean (1 1); -- source RedefinableElement
redefinedElement : RedefinableElement (0 *); -- source RedefinableElement
container : Region (0 1); -- source Vertex
incoming : Transition (0 *); -- source Vertex
outgoing : Transition (0 *); -- source Vertex
clientDependency : Dependency (0 *); -- source NamedElement
name : String (0 1); -- source NamedElement
nameExpression : StringExpression (0 1); -- source NamedElement

The string expression used to define the name of this named element.
{composite}
Subsets: Element.ownedElement

namespace : Namespace (0 1); -- source NamedElement
qualifiedName : String (0 1); -- source NamedElement
visibility : VisibilityKind (0 1); -- source NamedElement
ownedComment : Comment (0 *); -- source Element
ownedElement : Element (0 *); -- source Element
owner : Element (0 1); -- source Element

Constraints:

Signature: submachine_states() : Boolean;
Description: Only submachine states can have connection point references.
Expression: isSubmachineState implies connection->notEmpty ( )

Signature: submachine_or_regions() : Boolean;
Description: A state is not allowed to have both a submachine and regions.
Expression: isComposite implies not isSubmachineState

Signature: entry_or_exit() : Boolean;
Description: Only entry or exit pseudostates can serve as connection points.
Expression: connectionPoint->forAll(cp|cp.kind = #entry or cp.kind = #exit)

Signature: destinations_or_sources_of_transitions() : Boolean;
Description: The connection point references used as destinations/sources of transitions associated with a submachine state must be defined as entry/exit points in the submachine state machine.
The OCL used here is not normative.
Editor's notes: stateMachine, not statemachine.
Expression: self.isSubmachineState implies (self.connection->forAll (cp | cp.entry->forAll (p | p.stateMachine = self.submachine) and cp.exit->forAll (p | p.stateMachine = self.submachine)))
Original: self.isSubmachineState implies (self.connection->forAll (cp | cp.entry->forAll (p | p.statemachine = self.submachine) and cp.exit->forAll (p | p.statemachine = self.submachine)))

Signature: composite_states() : Boolean;
Description: Only composite states can have entry or exit pseudostates defined.
Expression: connectionPoint->notEmpty() implies isComoposite

Operations:

Signature: redefinitionContext.1() : Classifier;
Description: The redefinition context of a state is the nearest containing statemachine.
Expression: result = let sm = containingStateMachine() in if sm.context->isEmpty() or sm.general->notEmpty() then sm else sm.context endif

Signature: isSubmachineState.1() : Boolean;
Description: Only submachine states can have a reference statemachine.
Expression: result = submachine.notEmpty()

Signature: isSimple.1() : Boolean;
Description: A simple state is a state without any regions.
Expression: result = region.isEmpty()

Signature: isRedefinitionContextValid(redefined : State; ) : Boolean;
Description: The query isRedefinitionContextValid() specifies whether the redefinition contexts of a state are properly related to the redefinition contexts of the specified state to allow this element to redefine the other. The containing region of a redefining state must redefine the containing region of the redefined state.
Expression: result = true

Signature: isOrthogonal.1() : Boolean;
Description: An orthogonal state is a composite state with at least 2 regions
Expression: result = (region->size () > 1)

Signature: isConsistentWith(redefinee : RedefinableElement; ) : Boolean;
Description: The query isConsistentWith() specifies that a redefining state is consistent with a redefined state provided that the redefining state is an extension of the redefined state: A simple state can be redefined (extended) to become a composite state (by adding a region) and a composite state can be redefined (extended) by adding regions and by adding vertices, states, and transitions to inherited regions. All states may add or replace entry, exit, and 'doActivity' actions.
Expression: result = true

Signature: isComposite.1() : Boolean;
Description: A composite state is a state with at least one region.
Expression: result = region.notEmpty()

Signature: containingStateMachine() : StateMachine;
Description: The query containingStateMachine() returns the state machine that contains the state either directly or transitively.
Expression: result = container.containingStateMachine()



Send questions or comments to [email protected].