UML 2.6 RTF Avatar
  1. OMG Issue

UMLR — Issue against UML: implementation of OCL constraint containingProfile

  • Key: UMLR-345
  • Legacy Issue Number: 19488
  • Status: open  
  • Source: NIST ( Mr. Peter Denno)
  • Summary:

    Problem: Recursion in calls to the OCL operation containingProfile() does not properly terminate.

    Current OCL in the spec for Stereotype.containingProfile():
    self.namespace.oclAsType(Package).containingProfile()
    The problem with this is that the argument won't be seen as a Profile after oclAsType(Package).

    I suggest instead this OCL for Stereotype.containingProfile():
    if self.namespace.oclIsKindOf(Profile)
    then self.namespace
    else self.namespace.containingProfile()
    endif

    Current OCL in the spec for Package.containingProfile():
    if self.oclIsKindOf(Profile)
    then self.oclAsType(Profile)
    else self.namespace.oclAsType(Package).containingProfile()
    endif

    I suggest instead this OCL for Package.containingProfile():
    if self.oclIsKindOf(Profile)
    then self
    else self.namespace.containingProfile()
    endif

    There still may be problems if, for example, a Classifier (or other subtypes of Namespace) were a namespace for a Package. In those cases (which I assume don't really happen), we would need additional containingProfile() methods like the one on Package.

  • Reported: UML 2.5 — Wed, 25 Jun 2014 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT