Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Creating A Bi-Directional Referenced Based Link
Creating A Bi-Directional Referenced Based Link [message #147986] Mon, 27 August 2007 20:26 Go to next message
Eclipse User
Originally posted by: dan.krska.perspecsys.com

Is it possible to have a bi-directional referenced based link, so that
both nodes can have the link listed in their properties? Alternatively,
does being a target end of a link add a property somewhere that I maybe
haven't found yet?

I'll explain why I need one of these, so if there's a third option I
haven't considered it yet, someone can suggest it. What I'm trying to do
is limit the total amount of links in and out of a node, so that if I
have, for example, a node (n1) that is only allowed one connection, and it
connects out to another node, no other node can connect in to n1. As
well, I will be generating code using oAW from this diagram, and I need to
be able to reference relationships between nodes in the code generated.

Thanks for any help,

Dan!
Re: Creating A Bi-Directional Referenced Based Link [message #148037 is a reply to message #147986] Tue, 28 August 2007 07:49 Go to previous messageGo to next message
Eclipse User
Originally posted by: gmerin.integranova.com

Hi Dan! Have you tryed to create the link associations in your EMF
metamodel bidirectional? you can achive this creating two associations
(A and B, for example) between two model objects and making A.EOpposite
= B (or B.EOpposite=A). With this you have made a bidirectional
association (even though you will see two links, they are representing a
bidirectional association). In GMF you only have to map one of those
associations with a link because the other one will be created and
mantained automatically by EMF.

Hope it helps.
Gabriel.

Dan! wrote:
> Is it possible to have a bi-directional referenced based link, so that
> both nodes can have the link listed in their properties? Alternatively,
> does being a target end of a link add a property somewhere that I maybe
> haven't found yet?
>
> I'll explain why I need one of these, so if there's a third option I
> haven't considered it yet, someone can suggest it. What I'm trying to
> do is limit the total amount of links in and out of a node, so that if I
> have, for example, a node (n1) that is only allowed one connection, and
> it connects out to another node, no other node can connect in to n1. As
> well, I will be generating code using oAW from this diagram, and I need
> to be able to reference relationships between nodes in the code generated.
>
> Thanks for any help,
>
> Dan!
>
Re: Creating A Bi-Directional Referenced Based Link [message #148103 is a reply to message #148037] Tue, 28 August 2007 14:30 Go to previous message
Eclipse User
Originally posted by: dan.krska.perspecsys.com

Thanks very much Gabriel, that does exactly what I'm looking for :) I
hadn't even thought to play around with the EOpposite attribute, because
on my first day with GMF, I had played around with it and not seen any
results (I guess I didn't think to refresh the diagram, and I didn't know
about the properties view back then).

Again, thanks very much!

-Dan!
Previous Topic:Create child element on parent creation ...
Next Topic:How to know when a connection is moved (not reconnected)
Goto Forum:
  


Current Time: Sat Sep 20 22:14:36 GMT 2014

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

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