Issue 6872: UML 2 Super / state machines / misplaced operation definition (uml2-superstructure-ftf) Source: Simula Research Laboratory (Mr. Bran Selic, selic(at)acm.org) Nature: Uncategorized Issue Severity: Summary: The containingStateMachine() operation is defined in the "Additional Operations" for StateMachine (see section 15.3.12, page 491) rather than in the corrsponding section(s) for the type(s) to which it applies. Resolution: see above Revised Text: Actions taken: December 31, 2003: received issue March 8, 2005: closed issue Discussion: The following holds at present: A state machine is decomposed into 1 or more regions, which it owns. A region owns a set (possibly empty) of transitions and a set (possibly empty) of vertices. A special kind of vertex is a state, which can be decomposed into zero or more regions. The state owns its regions. The general rule, then, is that all transitions and vertices are owned by a region. However, there are two exceptions: the entry and exit points of a state machine, which are owned by the state machine itself, and references to entry and exit points, which are owned by the appropriate state. Based on this analysis, the function containingStateMachine() needs to be defined for each of the following classes: ??Vertices (the general case) with special provisions for connection point pseudostates and connectionpoint references. ??Regions ??Transitions The following changes need to be made: (1) Region: on page 476 add the following text after the “Additional constraints” subsection of the Region metaclass: Additional operations [1] The operation containingStateMachine() returns the state machine in which this Region is defined. context Region::containingStateMachine () : StateMachine: result = if stateMachine->isEmpty() then state.containingStateMachine() else stateMachine (2) Vertex: on page 506 add the following text following the “Associations” section of the Vertex metaclass: Additional operations [1] The operation containingStateMachine() returns the state machine in which this Vertex is defined. context Vertex::containingStateMachine () : StateMachine: result = if not container->isEmpty() then -- the container is a region container.containingStateMachine() else if (oclIsKIndOf(Pseudostate)) then -- entryor exit point? if (kind = #entryPoint) or (kind = #exitPoint) then stateMachine else if (oclIsKindOf(ConnectionPointReference)) then state.containingStateMachine() -- no other valid cases possible (3) Transition: on page 499 add the following text after the “Additional constraints” subsection of the Transition metaclass: Additional operations [1] The operation containingStateMachine() returns the state machine in which this Transition is defined. context Transition::containingStateMachine () : StateMachine: result = container.containingStateMachine() (4) StateMachine: (i) Remove constraint [5] of StateMachine on page 490 (ii) Remove additional operation [3] for StateMachine on page 491 For this to work, the association ends of StateMachine::connectionPoint and State::connection must be made navigable. This means that the following additional changes need to be made: (i) Replace the diagram for state machines in Figure 354 on page 457 with the following diagram: (ii) In the “Associations” sub-section of PseudoState, replace the statement “No additional associations” with the following item: ??stateMachine: StateMachine [0..1] The StateMachine in which this PseudoState is defined. This only applies to PseudoStates of the kind entryPoint or exitPoint. {Subsets Element::owner}. (iii) In the “Associations” sub-section of Connectio nPointReference, add the following item at the end of the list: ??state: State [0..1] The State in which this PseudoState is defined. {Subsets Element::owner}. End of Annotations:===== ubject: UML 2 Super / state machines / misplaced operation definition X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 From: Branislav Selic Date: Tue, 30 Dec 2003 09:43:59 -0500 X-MIMETrack: Serialize by Router on D25ML05/25/M/IBM(Release 6.0.2CF1|June 9, 2003) at 12/30/2003 09:44:00, Serialize complete at 12/30/2003 09:44:00 The containingStateMachine() operation is defined in the "Additional Operations" for StateMachine (see section 15.3.12, page 491) rather than in the corrsponding section(s) for the type(s) to which it applies. Bran Selic Distinguished Engineer IBM Rational Software OMG Issue No: 6872 Title: UML 2 Super / state machines / misplaced operation definition Source: International Business Machines (Mr. Bran Selic, bselic@ca.ibm.com) Summary: The containingStateMachine() operation is defined in the "Additional Operations" for StateMachine (see section 15.3.12, page 491) rather than in the corresponding section(s) for the type(s) to which it applies. Discussion: The following holds at present: A state machine is decomposed into 1 or more regions, which it owns. A region owns a set (possibly empty) of transitions and a set (possibly empty) of vertices. A special kind of vertex is a state, which can be decomposed into zero or more regions. The state owns its regions. The general rule, then, is that all transitions and vertices are owned by a region. However, there are two exceptions: the entry and exit points of a state machine, which are owned by the state machine itself, and references to entry and exit points, which are owned by the appropriate state. Based on this analysis, the function containingStateMachine() needs to be defined for each of the following classes: · Vertices (the general case) with special provisions for connection point pseudostates and connectionpoint references. · Regions · Transitions The following changes need to be made: (1) Region: on page 476 add the following text after the .Additional constraints. sub-section of the Region metaclass: Additional operations [1] The operation containingStateMachine() returns the state machine in which this Region is defined. context Region::containingStateMachine () : StateMachine: result = if stateMachine->isEmpty() then state.containingStateMachine() else stateMachine (2) Vertex: on page 506 add the following text following the .Associations. section of the Vertex metaclass: Additional operations [1] The operation containingStateMachine() returns the state machine in which this Vertex is defined. context Vertex::containingStateMachine () : StateMachine: result = if not container->isEmpty() then -- the container is a region container.containingStateMachine() else if (oclIsKIndOf(Pseudostate)) then -- entryor exit point? if (kind = #entryPoint) or (kind = #exitPoint) then stateMachine else if (oclIsKindOf(ConnectionPointReference)) then state.containingStateMachine() -- no other valid cases possible (3) Transition: on page 499 add the following text after the .Additional constraints. sub-section of the Transition metaclass: Additional operations [1] The operation containingStateMachine() returns the state machine in which this Transition is defined. context Transition::containingStateMachine () : StateMachine: result = container.containingStateMachine() (4) StateMachine: (i) Remove constraint [5] of StateMachine on page 490 (ii) Remove additional operation [3] for StateMachine on page 491 For this to work, the association ends of StateMachine::connectionPoint and State::connection must be made navigable. This means that the following additional changes need to be made: (i) Replace the diagram for state machines in Figure 354 on page 457 with the following diagram: (ii) In the .Associations. sub-section of PseudoState, replace the statement .No additional associations. with the following item: · stateMachine: StateMachine [0..1] The StateMachine in which this PseudoState is defined. This only applies to PseudoStates of the kind entryPoint or exitPoint. {Subsets Element::owner}. (iii) In the .Associations. sub-section of ConnectionPointReference, add the following item at the end of the list: · state: State [0..1] The State in which this PseudoState is defined. {Subsets Element::owner}. Disposition: Resolved