UML 2.6 RTF Avatar
  1. OMG Issue

UMLR — Definition of allOwningPackages()

  • Key: UMLR-435
  • Legacy Issue Number: 18806
  • Status: open  
  • Source: Model Driven Solutions ( Steve Cook)
  • Summary:

    NamedElement:: allOwningPackages() is documented as

    “The query allOwningPackages() returns all the Packages that in which this NamedElement is directly or indirectly contained, without any intervening Namespace that is not a Package.”

    But the OCL is

    if namespace.oclIsKindOf(Package)

    then

    let owningPackage : Package = namespace.oclAsType(Package) in

    owningPackage->union(owningPackage.allOwningPackages())

    else

    null

    endif

    Which would stop looking at any element not owned by a Package - which contradicts the documentation.

    I think it should instead read:

    allNamespaces()->select(oclIsKindOf(Package))

    But allOwningPackages is only used in Profile::references_same_metamodel, and I don’t like that either:

    All elements imported either as metaclassReferences or through metamodelReferences are members of the same base reference metamodel.

    inv: metamodelReference.importedPackage.elementImport.importedElement.allOwningPackages()->

    union(metaclassReference.importedElement.allOwningPackages() )->notEmpty()

    Surely this is completely wrong, both in its own right, and especially in the light of the following statement:

    Where both a metaclassReference and a metamodelReference are present on a profile, the latter is ignored and only the specific metaclasses are available.

    I’m thinking the right logic would be something like this:

    (metaClassReference->isEmpty() implies metamodelReference.importedPackage.member->forAll( m1, m2 | m1.allOwningPackages().intersection(m2.allOwningPackages())->notEmpty()))

    and

    metaclassReference.importedElement->forAll( m1, m2 | m1.allOwningPackages().intersection(m2.allOwningPackages())->notEmpty())

    Any comments?

  • Reported: UML 2.5b1 — Wed, 10 Jul 2013 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT