Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [M2M] How to transform UML2 model to EMF model
[M2M] How to transform UML2 model to EMF model [message #515914] Mon, 22 February 2010 08:44 Go to next message
Joachim Habib is currently offline Joachim HabibFriend
Messages: 2
Registered: February 2010
Junior Member
Hello,

First of all, I'm new on this forum and in eclipse "world" so if I'm posting at a wrong place, just tell me, thanks

I'm trying to implement a full MDD solutions based on eclipse frameworks :

1 - Modeling with UML2 tools (with my own profile and stereotypes)
2 - Generating Java and PHP code from this model

I digged as much as I could in eclipse forums and google answers to find howto/tutorial/doc about this subject. At the end, I conclude I had to do something like this

1 - Create UML2 profile
2 - Create EMF meta model (linked to my UML profile)
3 - Use OAW to generate code from model created from my EMF meta model (I know oaw is now part of eclipse project but I didn't have time to figure how it has been split, so I still refer to it as oaw).

So here I am, is it possible to have M2M transformation from an UML2 model based on profile/stereotype to EMF model based on meta model ?

Thank you very much ?

Joachim

Re: [M2M] How to transform UML2 model to EMF model [message #516191 is a reply to message #515914] Tue, 23 February 2010 06:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6438
Registered: July 2009
Senior Member
Hi Joachim

> So here I am, is it possible to have M2M transformation from an UML2
> model based on profile/stereotype to EMF model based on meta model ?

It's standard UML2 functionality, not M2M.

Open your UML model in the UML editor, select the root Package, then
invoke UML Editor->Convert To->Ecore Model..., or programmatically
look at UMLUtil.convertToEcore().

Regards

Ed Willink
Re: [M2M] How to transform UML2 model to EMF model [message #516271 is a reply to message #516191] Tue, 23 February 2010 13:14 Go to previous messageGo to next message
Joachim Habib is currently offline Joachim HabibFriend
Messages: 2
Registered: February 2010
Junior Member
Hey Edouard,

I tried to convert my UML model but I don't think it's what I want to do. Let me explain.

I created my own UML profile.
I created an ecore meta model as well (in order to use oaw workflow for code generation).
Both these profile and meta model are related to same domain and quite "identical".

Now, I create a new UML diagram based on my UML profile. As I know, xmi of this this model is EMF based.
I would like to transform my UML xmi to an Ecore model based on my Ecore meta model.
Result of this operation should be exactly the same than if I had design my EMF model with an generated editor from my meta model.

Am I clear ?

Thx

Joachim
Re: [M2M] How to transform UML2 model to EMF model [message #516291 is a reply to message #516271] Tue, 23 February 2010 14:20 Go to previous message
Erhard Weinell is currently offline Erhard WeinellFriend
Messages: 39
Registered: January 2010
Location: Kassel, Germany
Member
Hi Joachim,

Am 23.02.2010 14:14, schrieb Joachim Habib:

> Now, I create a new UML diagram based on my UML profile. As I know, xmi
> of this this model is EMF based.
> I would like to transform my UML xmi to an Ecore model based on my Ecore
> meta model. Result of this operation should be exactly the same than if
> I had design my EMF model with an generated editor from my meta model.

how would you (generically) map UML superstructure features to your
ecore model, e.g. StructuredClassifier.ownedAttribute representing a
classifier's attributes? In order to be fully aligned with an ecore
model, your profile would have to define each of these relations
explicitly between its stereotypes. Actually this IS technically
possible. However, the virtue of profiles is the functionality provided
by the UML core, which would be lost in this case.

However, you may of course define model transformations for a specific
profile / ecore model e.g. using M2T Xtend (with the UML2MetaModel
enabled). It might also work with ATL, haven't checked this though.

Best regards,
Erhard Weinell
Previous Topic:[Xtend] recursive extension call
Next Topic:[ATL] How to Clone/Copy source elements to multiple target elements
Goto Forum:
  


Current Time: Wed Aug 21 03:40:42 GMT 2019

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

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

Back to the top