[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.gmt] Re: [MOFScript] Many metamodels as input

With oAW it is possible (and straight forward) to use multiple models based on multiple metamodels (which themself could be made of different meta metamodels).
Here is an example workflow:


<workflow>
<component class="oaw.emf.XmiReader">
<metaModelFile value="metamodel1.ecore"/>
<modelFile value="mymodel.metamodel1"/>
<!-- storing the first model in the slot 'model1' -->
<outputSlot value="model1"/>
<firstElementOnly value="true"/>
</component>
<component class="oaw.emf.XmiReader">
<metaModelFile value="metamodel2.ecore"/>
<modelFile value="mymodel.metamodel2"/>
<!-- storing the second model in the slot 'model2' -->
<outputSlot value="model2"/>
<firstElementOnly value="true"/>
</component>
<component class="oaw.xpand2.Generator">
<metaModel class="oaw.type.emf.EmfMetaModel" metaModelFile="metamodel1.ecore"/>
<metaModel class="oaw.type.emf.EmfMetaModel" metaModelFile="metamodel2.ecore"/>
<!-- model1 is passed as an additional parameter -->
<expand value="templates::Root::root(model1) FOR model2"/>
<genPath value="main/src-gen/"/>
</component>
</workflow>


The Template file "template/Root.xpt" could look like this:


<<IMPORT metamodel1>> <<IMPORT metamodel2>>

<<DEFINE root(RootNode1 rt) FOR RootNode2>>
  do stuff
<<ENDDEFINE>>


regards, Sven



Yannick schrieb:
Hi,

I don't really know but I think it is not possible, at least it doesn't
look like you can.


However if you have an urgent need you might want to try oAW instead of MOFScript. I read in the documentation that you can read several models as one. The problem is that there is no specific tutorial about how to do so, in this case you might need to read a few in-depth doc or ask questions on the newsgroup.


Aitor Bediaga a écrit :
Hi everybody,

Has MOFScript support many (two for example) metamodels as input? I have
been trying this and seems that MOFScript only supports one metamodel as
input.

Can anybody help me?

Thanks.

Aitor.