[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.gmt.amw] Re: Do i have to use mwcore.ecore as the Metamodel of AMW

Hi,

The transformation AMWtoXSLT from the example was created to transform weaving models into XSLT models. The weaving model conforms to a metamodel that was created using the core (mwcore) + base extension (mw_base_extension) + domain specific extension (dbtoxmlweavingmm).

So I think the problem is not from AMW core, but in the extensions you use. If you use only the base extension, the AMWtoXSLT won't work correctly because it has some rules that match or do some calculation based on the metamodel elements defined in the dbtoxmlweavingmm package.

For instance, in the rule you defined below, the "select" statement selects all the "AMW!Left" elements. "AMW!Left" elements are part of the dbtoxmlweavingmm package, not of the base extension.

To know the elements you have in your weaving metamodel (to be able to write the transformations), you can save it in KM3 or Ecore. To do this, you right click over an element in the middle weaving panel.

I wrote something about writing transformations from AMW to transformation models in the AMW FAQ. The link is http://wiki.eclipse.org/index.php/AMW_FAQ.


Regards,

Marcos.

wg wrote:
Hi,

I tried to use mw_base_extension to define amw model. left and right model are just like Author and Person example and use the below atl to make transformation. please forget the mean of this atl(I just want to try). It does not work with my own amw, left ,right model(there is a type WLink in my own amw model).but if i change these from example of AMWtoXSLT, i mean, i just change amw,left,right model from the original example, then this atl works.I don't know,whether the Problem is from mwcore?
I have seen the mwcore.ecore, which has dbtoxmlweavingmm package, I think, this is some especial for the example from amw examples.
whatever there are too few Documents about,how to write amw to anther models.


Thanks
wg

module t1; -- Module Template
create OUT : XSLT from IN : AMW, left: MOF, right: MOF;


rule Link { from amw : AMW!WLink to xsl : XSLT!ApplyTemplatesStat ( select <-amw.end->select( e | e.oclIsTypeOf(AMW!Left))->first() ) }