Losing UML assocs converting to ecore [message #628196] |
Mon, 18 January 2010 11:13  |
Eclipse User |
|
|
|
Hi there,
I can't find what i want googling, so I'll try the forum.
If i'm out of order, pease say so.
I'm trying to convert from UML to Ecore in order to use the mapping editor. Alas if I do this, the UML associations are lost. I have read that this is the way the Ecore metamodel demands it. On the other hand, I read that Ecore-UML roundtrip converting is possible.
If I create a simple ecore model with Ereference and convert it to UML, the reference shows up as UML association and the roudtrip also works.
So, how can I convert UML associations to ecore Ereferences?
Thanks in advance,
Mobius
(using latest galileo)
|
|
|
Re: Losing UML assocs converting to ecore [message #628197 is a reply to message #628196] |
Mon, 18 January 2010 11:24   |
Eclipse User |
|
|
|
Mobius,
A bidirectional association generally maps to a pair of EReference
related via their eOpposites. This blog talks about a more general case
http://ed-merks.blogspot.com/2008/01/modeling-associations-w ith-ecore.html
that's not supported yet. It's not really clear why you're having a
problem. Perhaps an example would help.
Mobius wrote:
> Hi there,
>
> I can't find what i want googling, so I'll try the forum.
> If i'm out of order, pease say so.
>
> I'm trying to convert from UML to Ecore in order to use the mapping
> editor. Alas if I do this, the UML associations are lost. I have read
> that this is the way the Ecore metamodel demands it. On the other
> hand, I read that Ecore-UML roundtrip converting is possible. If I
> create a simple ecore model with Ereference and convert it to UML, the
> reference shows up as UML association and the roudtrip also works.
>
> So, how can I convert UML associations to ecore Ereferences?
>
> Thanks in advance,
>
> Mobius
>
> (using latest galileo)
|
|
|
|
|
|
Re: Losing UML assocs converting to ecore [message #628206 is a reply to message #628205] |
Mon, 25 January 2010 03:53  |
Eclipse User |
|
|
|
In my case I have an .UML file as a result of doing a UML class diagram with the GMF class diagram editor.
> What's the best way to convert all the assosiations in it to navigable ones?
This may depend on how associations are represented in your XMI file.
The GMF editor offers three categories of associations and if I choose "composite aggregation" then in the generated UML a node of type uml:Associonation is not referenced by the corresponding <ownedAttribute> elements in nodes of type uml:Class.
If I choose 'Navigable Association' this is different: In that case an association will be referenced in the source end class int the UML.
And sustains conversion to ECORE.
I'm no UML2 developer and just myself stumbled on the issue that normal associatons get lost when converting from UML to ECORE.
My model is small and so I could change all associations manually.
|
|
|
Powered by
FUDForum. Page generated in 0.07148 seconds