Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] tarnsform a GMF based diagram(handle XMI id and 2 metamodels in the same output files)
[ATL] tarnsform a GMF based diagram [message #508786] Wed, 20 January 2010 10:34 Go to next message
Stephane Masson is currently offline Stephane MassonFriend
Messages: 5
Registered: January 2010
Junior Member
Hello all,
I try to transform a file generated by a GMF editor that stores both the notation and the DSL model in the same file into a similar file (compatible with a similar GMF model), using ATL.
Up to now I was able to extract my DSL and the notation models (from the same file) and to transform them into 2 separate output files.
But I face 2 issues that I cannot solve with ATL.:
1- I lose the XMI id in the transformation, and I did not find a way to keept them (which is a problem because it means I loose the link between the 2 models)

2- I cannot create a single XMI file as output, storing the 2 models.

Thanks for your help !

Stephane.
Re: [ATL] tarnsform a GMF based diagram [message #509128 is a reply to message #508786] Thu, 21 January 2010 13:17 Go to previous messageGo to next message
Stephane Masson is currently offline Stephane MassonFriend
Messages: 5
Registered: January 2010
Junior Member
Ok, I found the solution for the ID issue:
this was a bug in the version of ATL I was using (release version 3.0.1). I upgraded to ATL 3.1.0M4 (2009/12/14) and it worked (milestone update site).
I am still working on the second issue (store in the same resource 2 models of 2 differents metamodels, using a single transformation)

Regards,
Stephane.
Re: [ATL] tarnsform a GMF based diagram [message #509176 is a reply to message #508786] Thu, 21 January 2010 15:20 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
If one of your metamodel is referencing the other then you can use this one as meta-model for the output model and use elements from the two meta-models.

If it isn't the case then you can make a virtual meta-model by creating one meta-model with only one class with no real meaning (I'm used to call that class 'Import') that inherits from one element (doesn't matter which) of each meta-model and then use this "fake" meta-model as output meta-model of the transformation.
Re: [ATL] tarnsform a GMF based diagram [message #509243 is a reply to message #508786] Thu, 21 January 2010 18:43 Go to previous messageGo to next message
Stephane Masson is currently offline Stephane MassonFriend
Messages: 5
Registered: January 2010
Junior Member
Thanks for your answer Sylvain.
I tryed the migration metamodel approach, but unfortunately the 2 meta models are too close from each other and i get naming conflicts (in the extenal references, the package and the class names are identical...).
Then the produced file is empty...
Thanks though!

Regards,
Stephane.
Re: [ATL] tarnsform a GMF based diagram [message #509313 is a reply to message #508786] Thu, 21 January 2010 22:47 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Well you still have the possibility to do it after the transformation in java using the EMF APIs then.

[Updated on: Thu, 21 January 2010 22:48]

Report message to a moderator

Re: [ATL] tarnsform a GMF based diagram [message #509351 is a reply to message #508786] Fri, 22 January 2010 08:34 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Well, in fact you can also use a fully-qualified syntax in ATL to solve name ambiguities :

to t : MM!"YourEPackageHere::YourClassHere"
Re: [ATL] tarnsform a GMF based diagram [message #509426 is a reply to message #509351] Fri, 22 January 2010 12:37 Go to previous message
Stephane Masson is currently offline Stephane MassonFriend
Messages: 5
Registered: January 2010
Junior Member
Yes, but in my case the meta models have the same name of package and classes (basicaly my use case is a meta model evolution). So the only difference is the ressource (ecore file) providing the package.
I think I will use a different strategy:
1- in the ATL transfo I migrate only the DSL part using a standard ATL IN: OLD_MM => OUT: NEW_MM
2- In a second transfo (or the same with several outputs), i create a model following a dedicated migration metamodel (storing the reference of an EObject and its XMI ID and all other relevant informations)
3- in a specific JAVA code, I merge the DSL and the Notation model in a single resource, assigning back the XMI IDs of the original EObjects.
Thanks for the inputt!

Regards,
Stephane.
Previous Topic:Change output format to XML instead XMI
Next Topic:ATL :mapping between Enum
Goto Forum:
  


Current Time: Fri Apr 19 20:01:38 GMT 2024

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

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

Back to the top