[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.gmt.amw] Re: [ATL] Get model's name
|
Hi Benjamin,
As Hugo said, ATL does not have a "native" solution to get the path of
models.
However, you can use the AMW Model Handler to obtain such facility.
The model handler has a method called generateModelRef(), which can be
called by any model element. For instance, you can call
MOF!EPackage.generateModelRef('modelname').
'modelname' is the name of the model declared in the ATL header. It
returns a String with the URI of the model.
To be able to use the handler, you must install the model handler
plug-in, and choose 'AMW' in the list of model handlers in the ATL
launch configuration.
The following link has more information about using the handler:
http://wiki.eclipse.org/index.php/AMW_Model_Handler#generateModelRef
Regards,
Marcos.
Hugo Bruneliere wrote:
Hi Benjamin,
The paths to access to the woven models are not directly stored into the
weaving model (".amw" file). They are stored into a separated XML
document (".amw.prop" file) which also contains additional information
such as the extensions of the core weaving metamodel which are used.
So basically your ATL transformation will takes as input the 2 woven
models and will generates as output the weaving model + the XML model
corresponding to the ".amw.prop" XML file.
About the problem of directly getting the path of an input model in an
ATL transformation, it is not realizable with the current version of ATL.
A solution is to add a parameter model (e.g. an XML model), which will
contain the missing information (i.e. the paths of the models), as an
additional input of your transformation.
I also forward this post to the AMW newsgroup as your problem also is
indirectly related to AMW.
Best regards,
Hugo
Benjamin CHEVALLEREAU a écrit :
Hi,
I try to get a weaving model from 2 input models with an ATL
transformation. I need to fill (in the weaving model) the path to
access to models. Is it possible to get it in the ATL transformation ?
Thanks