Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How can i set save option for element as QualifiedName ?
How can i set save option for element as QualifiedName ? [message #1232247] Thu, 16 January 2014 14:08 Go to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
Registered: January 2013
Location: Izmir
Senior Member
Hi all,

When i save my model elements releations saved with Sequence Numbers like;

end1Entity="#//@ownedEntityModel/@entities.0"


but on diagram when i switch my models with drag and drop my relation broken cause of Sequence Numbers. My releation always shows 0. element on ownedEntityModel.

so i need to save my model as qualified name. How can i do this ? There is an proper save option ?

Regards


[Updated on: Thu, 16 January 2014 14:17]

Report message to a moderator

Re: How can i save option for element as QualifiedName ? [message #1240908 is a reply to message #1232247] Fri, 07 February 2014 08:11 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31825
Registered: July 2009
Senior Member
Serhat,

I've been away on vacation...

If an entity has an attribute (or combination of attributes) that make
it unique within the "entities" containment reference you can specify
that attribute (those attributes) as the eKeys of that containment
reference to produce the fragment segment @enties[key='value'] instead
and that will be resilient to reordering changes. Alternatively you
could have a look at how EModelElementImpl specializes the fragment
segments for Ecore models via
org.eclipse.emf.ecore.impl.EModelElementImpl.eURIFragmentSegment(EStructuralFeature,
EObject) and
org.eclipse.emf.ecore.impl.EModelElementImpl.eObjectForURIFragmentSegment(String).


On 16/01/2014 3:08 PM, serhat gezgin wrote:
> Hi all,
>
> When i save my model elements releations saved with Sequence Numbers
> like;
>
>
> end1Entity="#//@ownedEntityModel/@entities.0"
>
>
> but on diagram when i switch my models with drag and drop my relation
> broken cause of Sequence Numbers. My releation always shows 0. element
> on ownedEntityModel.
>
> so i need to save my model as qualified name. How can i do this ?
> There is an proper save option ?
>
> Regards
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How can i save option for element as QualifiedName ? [message #1245282 is a reply to message #1240908] Thu, 13 February 2014 15:19 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
Registered: January 2013
Location: Izmir
Senior Member
Hi Ed,

I try using UUIDs. But i think there is a problem with this.

When i extend XMIResource and use UUID; some elements have xmi.id but someone not have

like;
<?xml version="1.0" encoding="UTF-8"?>
<content:ContentModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:content="http://www.mdd4cca.com/msf/content/Content" xmi:id="_oPDHIJTBEeO-OoAj4bvJwg">
  <ownedEntityModel name="EntityModel">
    <entities name="E1"/>
  </ownedEntityModel>
</content:ContentModel>


Do you know this problem?

I thik, if i can solve this, my problems are solved automatically.

Regards
Re: How can i save option for element as QualifiedName ? [message #1245683 is a reply to message #1245282] Fri, 14 February 2014 05:37 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31825
Registered: July 2009
Senior Member
Serhat,

Comments below.

On 13/02/2014 4:19 PM, serhat gezgin wrote:
> Hi Ed,
>
> I try using UUIDs. But i think there is a problem with this.
>
> When i extend XMIResource and use UUID; some elements have xmi.id but
> someone not have
>
> like;
>
> <?xml version="1.0" encoding="UTF-8"?>
> <content:ContentModel xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:content="http://www.mdd4cca.com/msf/content/Content"
> xmi:id="_oPDHIJTBEeO-OoAj4bvJwg">
> <ownedEntityModel name="EntityModel">
> <entities name="E1"/>
> </ownedEntityModel>
> </content:ContentModel>
>
>
> Do you know this problem?
Might it be the case that you've defined the "name" EAttribute of each
of those two things to have isID true? In
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.attachedHelper(EObject)
you can see that if an object has an intrinsic ID it won't be assigned
an extrinsic one.
>
> I thik, if i can solve this, my problems are solved automatically.
Likely just change your model not to specify intrinsic IDs.
>
> Regards


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How can i save option for element as QualifiedName ? [message #1248652 is a reply to message #1245683] Mon, 17 February 2014 14:04 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
Registered: January 2013
Location: Izmir
Senior Member
Hi Ed,

Sory for late answer.

My all attributes " ID = false " like added pic. The problem might be different. But still i can't find

Regards
  • Attachment: property.png
    (Size: 14.31KB, Downloaded 100 times)
Re: How can i save option for element as QualifiedName ? [message #1249271 is a reply to message #1248652] Tue, 18 February 2014 04:47 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31825
Registered: July 2009
Senior Member
Have a look at what's happening in
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.attachedHelper(EObject).
That should be called for each object attached to the resource (i.e.,
for each object contained by the resource). It should assign an ID.

On 17/02/2014 3:04 PM, serhat gezgin wrote:
> Hi Ed,
>
> Sory for late answer.
>
> My all attributes " ID = false " like added pic. The problem might be different. But still i can't find
>
> Regards


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMFClient 1.2
Next Topic:[EMFStore/ECP] Can't add more than approx. 58.000 model elements to project
Goto Forum:
  


Current Time: Sat Apr 10 20:19:48 GMT 2021

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

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

Back to the top