Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Losing UML assocs converting to ecore
Losing UML assocs converting to ecore [message #628196] Mon, 18 January 2010 16:13 Go to next message
Mobius  is currently offline Mobius Friend
Messages: 42
Registered: January 2010
Member
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 16:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
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)


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Losing UML assocs converting to ecore [message #628199 is a reply to message #628196] Tue, 19 January 2010 15:55 Go to previous messageGo to next message
Mobius  is currently offline Mobius Friend
Messages: 42
Registered: January 2010
Member
Ed,

Better return to what I really want to do.
I have a (huge) international common information model (IEC57) + local datamodels for asset and gis information all in UML (class) models.
I have to map our internal datamodels to the relevant opposites in the common information model (CIM) (profile).
Because I am fed up with dodgy Excel sheets, I want to have some tooling for this mapping so I can work more intuitively and mappings are really hardlinked to the models themselves.
After some searching I stumbled on the Ecore2Ecore mapping and tried it out. Since this mapping involves n:m object/attribute to abject/attribute (e.g. the attributes of 1 local class might map to attributes of multiple classes in the CIM and vice-versa) I need the associations for this.

That's what I was searching for,

Any suggestions?

Best Regards,

Mobius
Re: Losing UML assocs converting to ecore [message #628202 is a reply to message #628196] Fri, 22 January 2010 11:01 Go to previous messageGo to next message
Stefan is currently offline StefanFriend
Messages: 6
Registered: January 2010
Location: Berlin
Junior Member
> So, how can I convert UML associations to ecore Ereferences?

For mapping a model to ECORE you have to use navigable associations.
In the diagram just use "Navigable Association" instead of Composite (or Shared) Aggregation
(you may then set its "Aggregation" property to "Composite").
Only in this case GMF will model them as class attributes in the UML.
These will then show up as EReference when converting to an ECORE model.
Re: Losing UML assocs converting to ecore [message #628205 is a reply to message #628196] Fri, 22 January 2010 12:40 Go to previous messageGo to next message
Mobius  is currently offline Mobius Friend
Messages: 42
Registered: January 2010
Member
Stefan,

This might help, but ...

The large model isn't mine. What's the best way to convert all the assosiations in it to navigable ones. Is there a xslt somewhere outhere that can convert them in my xmi file??

Best Regards,

Mobius
Re: Losing UML assocs converting to ecore [message #628206 is a reply to message #628205] Mon, 25 January 2010 08:53 Go to previous message
Stefan is currently offline StefanFriend
Messages: 6
Registered: January 2010
Location: Berlin
Junior Member
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.
Previous Topic:Losing UML assocs converting to ecore
Next Topic:UML/EMX
Goto Forum:
  


Current Time: Fri Mar 29 13:27:17 GMT 2024

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

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

Back to the top