Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Resolve proxy containing qualifiedName(How to manage simple reference of UML elements by its qualifiedName in eProxy)
Resolve proxy containing qualifiedName [message #1736886] Mon, 04 July 2016 08:34 Go to next message
Nicolas FAUVERGUE is currently offline Nicolas FAUVERGUEFriend
Messages: 13
Registered: February 2014
Junior Member
Hello,

Currently, i want to reference an object from UML by its qualifiedName (from an eProxy). The prupose of this need is to load UML elements from an eProxy containing their qualifiedName and only use the 'resolve' method.

I tried this for an attribute type and for a stereotype. This works fine for the stereotype but not for the attribute type as following (this works fine for both with their xmiid reference):

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="20131001" xmlns:RootElement="schemas/RootElement/_LGC7ED9xEeagOoaTDa23Ww/0" xsi:schemaLocation="schemas/RootElement/_LGC7ED9xEeagOoaTDa23Ww/0 ../project/testProfile.profile.uml#_LGF-YT9xEeagOoaTDa23Ww">
  <uml:Model xmi:id="_Xz2I4D38EeaHCOjtpwqX8A" name="RootElement">
    <packagedElement xmi:type="uml:Class" xmi:id="_wPMdcD38EeaHCOjtpwqX8A" name="Class1">
      <ownedAttribute xmi:type="uml:Property" xmi:id="_sqOcYD9xEeagOoaTDa23Ww" name="Attribute1">
        <type xmi:type="uml:Class" href="../project/testType.uml#//RootElement/Type1"/>
      </ownedAttribute>
    </packagedElement>
    <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_AY3mgEG9EeaRt-jEcozggA">
      <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_AY8fAEG9EeaRt-jEcozggA">
        <references xmi:type="ecore:EPackage" href="../project/testProfile.profile.uml#_LGF-YT9xEeagOoaTDa23Ww"/>
      </eAnnotations>
      <appliedProfile xmi:type="uml:Profile" href="../project/testProfile.profile.uml#//RootElement/Stereotype1"/>
    </profileApplication>
  </uml:Model>
  <RootElement:Stereotype1 xmi:id="_CIRuoEG9EeaRt-jEcozggA" base_Class="_wPMdcD38EeaHCOjtpwqX8A"/>
</xmi:XMI>


As stipulated in the code, the references to attribute type must be '../project/testType.uml#//RootElement/Type1' and the stereotype ''../project/testProfile.profile.uml#//RootElement/Stereotype1'.

Did i make a mistake in my example ? Or maybe another way is better to reference my UML elements ?

Thanks in advance for your helpful.

Best regards,
Nicolas
Re: Resolve proxy containing qualifiedName [message #1737095 is a reply to message #1736886] Tue, 05 July 2016 15:51 Go to previous message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1176
Registered: July 2009
Location: Canada
Senior Member

Hi, Nicolas,

UML resources use UUIDs as the xmi:id, and the xmi:id as the URI
fragment. So, you cannot reference a model element using its qalified
name as the URI fragment. You must use the XMI ID. See, for example,
how this works in the href of the <references> element in the
annotation of the profile application.

Your application of the 'Stereotype1' stereotype on the class loads
because of the xmlns:RootElement namespace declaration, not because of
the profile application which is actually broken: you appear to be
trying to reference a stereotype as the applied profile, and that by
its qualified name, which as per above will not work.

HTH,

Christian


On 2016-07-05 14:39:18 +0000, Nicolas FAUVERGUE said:

> Hello,
>
> Currently, i want to reference an object from UML by its qualifiedName
> (from an eProxy). The prupose of this need is to load UML elements from
> an eProxy containing their qualifiedName and only use the 'resolve'
> method.
>
> I tried this for an attribute type and for a stereotype. This works
> fine for the stereotype but not for the attribute type as following
> (this works fine for both with their xmiid reference):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="20131001"
> xmlns:RootElement="schemas/RootElement/_LGC7ED9xEeagOoaTDa23Ww/0"
> xsi:schemaLocation="schemas/RootElement/_LGC7ED9xEeagOoaTDa23Ww/0
> ../project/testProfile.profile.uml#_LGF-YT9xEeagOoaTDa23Ww">
> <uml:Model xmi:id="_Xz2I4D38EeaHCOjtpwqX8A" name="RootElement">
> <packagedElement xmi:type="uml:Class"
> xmi:id="_wPMdcD38EeaHCOjtpwqX8A" name="Class1">
> <ownedAttribute xmi:type="uml:Property"
> xmi:id="_sqOcYD9xEeagOoaTDa23Ww" name="Attribute1">
> <type xmi:type="uml:Class"
> href="../project/testType.uml#//RootElement/Type1"/>
> </ownedAttribute>
> </packagedElement>
> <profileApplication xmi:type="uml:ProfileApplication"
> xmi:id="_AY3mgEG9EeaRt-jEcozggA">
> <eAnnotations xmi:type="ecore:EAnnotation"
> xmi:id="_AY8fAEG9EeaRt-jEcozggA">
> <references xmi:type="ecore:EPackage"
> href="../project/testProfile.profile.uml#_LGF-YT9xEeagOoaTDa23Ww"/>
> </eAnnotations>
> <appliedProfile xmi:type="uml:Profile"
> href="../project/testProfile.profile.uml#//RootElement/Stereotype1"/>
> </profileApplication>
> </uml:Model>
> <RootElement:Stereotype1 xmi:id="_CIRuoEG9EeaRt-jEcozggA"
> base_Class="_wPMdcD38EeaHCOjtpwqX8A"/>
> </xmi:XMI>
>
>
> As stipulated in the code, the references to attribute type must be
> '../project/testType.uml#//RootElement/Type1' and the stereotype
> ''../project/testProfile.profile.uml#//RootElement/Stereotype1'.
>
> Did i make a mistake in my example ? Or maybe another way is better to
> reference my UML elements ?
>
> Thanks in advance for your helpful.
>
> Best regards,
> Nicolas
Previous Topic:How to add time related information in state machine?
Next Topic:Missing SendOperationEvent, ReceiveOperationEvent in recent versions of UML2
Goto Forum:
  


Current Time: Wed Nov 14 00:52:24 GMT 2018

Powered by FUDForum. Page generated in 0.02022 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top