Transforming from ecore to a genmodel-like configuration model [message #509950] |
Mon, 25 January 2010 21:18 |
St Messages: 77 Registered: July 2009 |
Member |
|
|
Hi,
I have created a metamodel with one eclass named eclass2record to help me manage the transformation process.
The goal is to created a doctrine model (expressed in doctrine.ecore) from an ecore model.
To achieve this, I have created the eclass2record; basically all eclasses have a eclass2record, and the eclass2record instance have to be linked with the eclass.
So in the transformation I have written this :
rule ecore2ecore2doctrine
transform i : ecore!EClass
to o : ecore2doctrine!EClass2Record
{
o.name = i.name;
o.eclass = i;
}
mm :
@namespace(uri="http://se.ecore2doctrine/1", prefix="ecore2doctrine")
package ecore2doctrine;
import "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore";
import "http://se.doctrine.mm/1/Connection";
class EClass2Record {
attr String[1] name;
attr boolean[1] generate = true;
ref ecore.EClass[1] eclass;
ref doctrine.Record.Record record;
attr boolean regenerate = true;
attr ecore.EBoolean[1] generated = "false";
}
//you can delete the ref doctrine.Record.Record record; line
It generates me the .xmi file as requested with all eclass2record objects with correct names, but there is no eclass relation set up between eclass2record instances and their relative eclass.
Someone have a clue ?
Thanks !
edit: added mm emfatic
[Updated on: Mon, 25 January 2010 21:23] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04142 seconds