UML 1.4 NO IDEA Avatar
  1. OMG Issue

UML14 — Initial state for composite states - OCL example and missing constraint

  • Key: UML14-100
  • Legacy Issue Number: 5273
  • Status: closed  
  • Source: Adaptive ( Mr. Pete Rivett)
  • Summary:

    This issue was triggered by what seemed to be an ill-formed state machine
    example which revealed a deeper lack of rigor in the spec.

    The example state machine in section 6.5.10 (illustrating oclInState) does
    not have an initial pseudostate within the 'Off' state. Section 3.80.2
    indicates that this is mandatory:
    "A transition drawn to a composite state boundary indicates a transition to
    the
    composite state. This is equivalent to a transition to the initial
    pseudostate within the
    composite state region. The initial pseudostate must be present."

    [Aside: There's also typo in the list of valid OCL expressions in 6.5.10:
    object.oclInState(Off:NoPower) should have a double colon:
    object.oclInState(Off::NoPower)].

    If indeed it is mandatory to have an initial state where there is a
    transition to a composite state (this does seem sensible for
    predictability), this should be reflected in a constraint within the
    abstract Syntax (section 2.12) to the effect that a CompositeState with
    'incoming' Transitions must contain an initial PseudoState.

    For example 2.12.4.3 contains the following which implies an initial
    pseudostate, though uses the ill-defined 'default transition' as well as
    'initial transition':
    "Entering a non-concurrent composite state
    Upon entering a composite state, the following cases are differentiated:
    • Default entry: Graphically, this is indicated by an incoming transition
    that
    terminates on the outside edge of the composite state. In this case, the
    default
    transition is taken. If there is a guard on the transition it must be
    enabled (true). (A
    disabled initial transition is an ill-defined execution state and its
    handling is not
    defined.) The entry action of the state is executed before the action
    associated with
    the initial transition."

    Proposed Resolution
    -------------------

    1. Change example in 6.5.10 to add an initial pseudostate within the 'Off'
    composite with a transition to 'Standby'.

    2. Correct typo in 6.5.10 valid expressions: object.oclInState(Off:NoPower)
    should have a double colon: object.oclInState(Off::NoPower)

    3. Add the following constraint to section 2.12.3.1
    [7] A composite state with an incoming transition must have an initial
    state.
    self.incoming->notEmpty() implies
    self.subvertex->select (v | v.oclIsKindOf(Pseudostate))->select(p :
    Pseudostate | p.kind = #initial)->size = 1

    4. Alter the section in 2.12.4.3 to read as follows:
    "Entering a non-concurrent composite state
    Upon entering a composite state, the following cases are differentiated:
    • Default entry: Graphically, this is indicated by an incoming transition
    that
    terminates on the outside edge of the composite state. In this case, there
    must be an initial state and the initial
    transition is taken. If there is a guard on the transition it must be
    enabled (true). (A
    disabled initial transition is an ill-defined execution state and its
    handling is not
    defined.) The entry action of the state is executed before the action
    associated with
    the initial transition."

  • Reported: XMI 1.3 — Thu, 9 May 2002 04:00 GMT
  • Disposition: Resolved — UML 1.4.2
  • Disposition Summary:

    see above, resolved

  • Updated: Fri, 6 Mar 2015 20:58 GMT