Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » How do I link by ID instead of hierarchy
How do I link by ID instead of hierarchy [message #999194] Fri, 11 January 2013 14:48 Go to next message
Roman U is currently offline Roman UFriend
Messages: 2
Registered: January 2013
Junior Member
Hi

I am trying to use Graphiti to define relationships between some business objects. The objects themselves are not created within Graphiti but in another editor.

Dragging the objects into the Graphiti editor and defining relationships works find. However, when I create or delete business objects in the other editor, Graphiti gets confused. It exchanges the objects for the ones that were directly below or above them.

Looking at the saved file, this seems to be the case because Graphiti links to the business objects by means of their hierarchical position within my original xmi file. If the other editor changes the hierarchy, that becomes a problem.

Browsing the forum for help, I already found out that one can also link the business objects by ID. (for example http://www.eclipse.org/forums/index.php/m/409120/?srch=link+hierarchical#msg_409120)
I did not find any information on how to do it though, neither here nor in the documentation.

Now I am starting to be afraid that this is to trivial to merit any documentation Smile
Simply defining an ID in the model changed nothing for me, as did setting the EReference.eKeys.

Should it be that simple (automatic) and simply is not working for me, or can someone point me to what I need to know to change this behavior?
Re: How do I link by ID instead of hierarchy [message #999315 is a reply to message #999194] Fri, 11 January 2013 20:02 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 601
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

This is actually and EMF question, since it's EMF that determines how to
encode the fragment part (the part after the #) of the URI pointing to
an object within a resource.

Try using the id or key feature of the attribute, to tell the resource
that this attribute is either unique within the whole resource or unique
within its eContainer. This should affect the fragment.

Hallvard

On 11.01.13 11.13, Roman U wrote:
> Hi
>
> I am trying to use Graphiti to define relationships between some
> business objects. The objects themselves are not created within Graphiti
> but in another editor.
>
> Dragging the objects into the Graphiti editor and defining relationships
> works find. However, when I create or delete business objects in the
> other editor, Graphiti gets confused. It exchanges the objects for the
> ones that were directly below or above them.
> Looking at the saved file, this seems to be the case because Graphiti
> links to the business objects by means of their hierarchical position
> within my original xmi file. If the other editor changes the hierarchy,
> that becomes a problem.
>
> Browsing the forum for help, I already found out that one can also link
> the business objects by ID. (for example
> http://www.eclipse.org/forums/index.php/m/409120/?srch=link+hierarchical#msg_409120)
>
> I did not find any information on how to do it though, neither here nor
> in the documentation.
>
> Now I am starting to be afraid that this is to trivial to merit any
> documentation :)
> Simply defining an ID in the model changed nothing for me, as did
> setting the EReference.eKeys.
>
> Should it be that simple (automatic) and simply is not working for me,
> or can someone point me to what I need to know to change this behavior?
Re: How do I link by ID instead of hierarchy [message #999581 is a reply to message #999194] Sat, 12 January 2013 14:42 Go to previous message
Roman U is currently offline Roman UFriend
Messages: 2
Registered: January 2013
Junior Member
Maybe I do not know enough about EMF yet.

But if I understand it correctly, you are saying that if in my model I defined a a field as an ID (I did) or defined an EKey for the containment (I did) the path/fragment should change automatically?

In that case maybe I should remake my model to see if I forgot anything, as it does not seem to happen.
Previous Topic:Load EMF
Next Topic:Content assistant provided?
Goto Forum:
  


Current Time: Sun Dec 21 21:42:36 GMT 2014

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

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