Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Metamodel migration, how to ?
Metamodel migration, how to ? [message #535091] Fri, 21 May 2010 09:36 Go to next message
Sébastien  Gandon is currently offline Sébastien GandonFriend
Messages: 184
Registered: July 2009
Senior Member
Hello,
I have a big ecore metamodel(myMetaModelv1.ecore) that I refactored by changing a few inheritance and some class attributes and references (myMetaModelv2.ecore).

I am in the process of writing a migration engine for all the models conforming to the old metamodel, so I tought of using some M2M transformation.
I looked at the ATL transformation user guide and it seems that I need to create a copy of all the old model instance into the new model.

My problem is that most of the classes have not been renamed and still have the same attributes, the changes I have made just concern a small amount of classes.
I there any mean such as a ecore transformation/generation that could help me generate the atl script for the copy of the old instance to the new ones automatically ?
Is there another approach to take ?

Thanks for any lead.

SeB.
Re: Metamodel migration, how to ? [message #535114 is a reply to message #535091] Fri, 21 May 2010 10:40 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Have a look here (EModelCopyGenerator.atl).
Re: Metamodel migration, how to ? [message #535115 is a reply to message #535091] Fri, 21 May 2010 10:39 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 21/05/2010 11:36, seb.fr a écrit :
> Hello, I have a big ecore metamodel(myMetaModelv1.ecore) that I
> refactored by changing a few inheritance and some class attributes and
> references (myMetaModelv2.ecore).
>
> I am in the process of writing a migration engine for all the models
> conforming to the old metamodel, so I tought of using some M2M
> transformation.
> I looked at the ATL transformation user guide and it seems that I need
> to create a copy of all the old model instance into the new model.
> My problem is that most of the classes have not been renamed and still
> have the same attributes, the changes I have made just concern a small
> amount of classes.
> I there any mean such as a ecore transformation/generation that could
> help me generate the atl script for the copy of the old instance to the
> new ones automatically ?
> Is there another approach to take ?
>
> Thanks for any lead.
>
> SeB.

You may use the ATL refining mode:
http://wiki.eclipse.org/ATL/User_Guide_-_Overview_of_the_Atl as_Transformation_Language#Refining_mode_execution_semantics

--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: Metamodel migration, how to ? [message #535128 is a reply to message #535115] Fri, 21 May 2010 11:50 Go to previous messageGo to next message
Sébastien  Gandon is currently offline Sébastien GandonFriend
Messages: 184
Registered: July 2009
Senior Member
I have tried one simple refining transformation which does nothing
------------------------------------------------------------
-- @path MM=/org.talend.model/model/metadata.ecore
-- @path OLDMM=/org.talend.model.transformation/old_models/metadata.e core

module TosMetadata400to410;
create OUT : MM refining IN : OLDMM;
------------------------------------------------------------ ---

and the output gets empty which I understand because I do not know how the mapping would be done between the 2 model classes because althougth the have the same name and belong to the same package and almmost have the same attributes, the package names space URI have been change to reflect the change of version and I am affraid they are considered as completly different models.

How does ATL handle refining from one metamodel to another ?
Re: Metamodel migration, how to ? [message #535132 is a reply to message #535114] Fri, 21 May 2010 12:02 Go to previous messageGo to next message
Sébastien  Gandon is currently offline Sébastien GandonFriend
Messages: 184
Registered: July 2009
Senior Member
Sylvain EVEILLARD wrote on Fri, 21 May 2010 06:40
Have a look here (EModelCopyGenerator.atl).


Thank fo the tip, This seems to be what I am looking for althoug I am looking at Atlas Model Weaving also.
But I do not know how to use the given ATL, do you have any lead or tutorial on how to use the query the user guide is not sufficent.
Is there any book I could get have deeper information on ATL ?

Anyway thaks for this quick answer.

SeB.
Re: Metamodel migration, how to ? [message #535156 is a reply to message #535132] Fri, 21 May 2010 12:51 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
seb.fr wrote on Fri, 21 May 2010 08:02
Sylvain EVEILLARD wrote on Fri, 21 May 2010 06:40
Have a look here (EModelCopyGenerator.atl).


Thank fo the tip, This seems to be what I am looking for althoug I am looking at Atlas Model Weaving also.
But I do not know how to use the given ATL, do you have any lead or tutorial on how to use the query the user guide is not sufficent.
Is there any book I could get have deeper information on ATL ?

Anyway thaks for this quick answer.

SeB.

A query is just a standard transformation but you only add input models. Here the input model is your metamodel conforming to ecore (be sure to use the 'isMetaMetaModel' checkbox).Be careful tho that with ATL v3, the writeTo helper is no longer relative to the workspace but to the eclipse installation folder instead (that is really puzzling I know). So, just use an absolute path.
Re: Metamodel migration, how to ? [message #535170 is a reply to message #535156] Fri, 21 May 2010 13:25 Go to previous message
Sébastien  Gandon is currently offline Sébastien GandonFriend
Messages: 184
Registered: July 2009
Senior Member
Thanks, I manage to generate the copy.atl file from the script.
Now I'll try to make it work.

SeB.


Sylvain EVEILLARD wrote on Fri, 21 May 2010 08:51
seb.fr wrote on Fri, 21 May 2010 08:02
Sylvain EVEILLARD wrote on Fri, 21 May 2010 06:40
Have a look here (EModelCopyGenerator.atl).


Thank fo the tip, This seems to be what I am looking for althoug I am looking at Atlas Model Weaving also.
But I do not know how to use the given ATL, do you have any lead or tutorial on how to use the query the user guide is not sufficent.
Is there any book I could get have deeper information on ATL ?

Anyway thaks for this quick answer.

SeB.

A query is just a standard transformation but you only add input models. Here the input model is your metamodel conforming to ecore (be sure to use the 'isMetaMetaModel' checkbox).Be careful tho that with ATL v3, the writeTo helper is no longer relative to the workspace but to the eclipse installation folder instead (that is really puzzling I know). So, just use an absolute path.

Previous Topic:UML2OWL transformation gives error
Next Topic:[ATL] empty Sequence
Goto Forum:
  


Current Time: Thu Apr 25 05:01:02 GMT 2024

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

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

Back to the top