From generated model to text [message #102122] |
Fri, 20 March 2009 08:10  |
Eclipse User |
|
|
|
I've successfully managed to run an ATL-transformation from an instance of
one metamodel to an instance of another metamodel. In the next step I need
a text representation of the generated model.
I've tried to use JET for M2T transformation, but I think that I can
access the elements in the model only via XPath. That means I have to go
down to the level of XML. As far as I found out I cannot use the structure
of the ecore-metamodel to access the nodes of the model with JET as I can
do in ATL transformation-rules.
Therefore my question is:
How can I generate text from a model using the structure of the
ecore-metamodel to access the nodes?
Thanks for your help,
Marion
|
|
|
|
|
|
Re: From generated model to text [message #102232 is a reply to message #102216] |
Mon, 23 March 2009 13:26  |
Eclipse User |
|
|
|
Marion pisze:
> Thank you, Krzysztof, Xpand looks very promising. Still, for me it seems
> not possible to use any model generated with ATL for Xpand. Are there
> contraints on how to write the metamodels? Do I have to write the ATL
> transformation-rules in a certain way to be able to generate code from
> the resulting model with Xpand?
As long as output model is an Ecore model, there is no problem. You just
have to forward your model somehow.
Xpand use special workflow, that is now developed under Eclipse. I would
try to implement a component for that workflow that runs the ATL
transformation and put outcome in slot, that will be used by Xpand in
next step.
For today:
http://www.openarchitectureware.org/pub/documentation/4.3.1/ html/contents/workflow_reference.html
For future (Eclipse 3.5):
http://www.eclipse.org/modeling/emft/?project=mwe
They are in different packages but it is almost same thing.
Maybe ATL itself will provide a component for MWE? In older version of
openArchitectureWare, there was a workflow component to invoke ATL
transformation, it is not included in last oAW, but I think you need to
implement just one interface/class to achieve it (I guess
WorkflowComponentWithModelSlot or AbstractWorkflowComponent would be
good). It should be really easy, it just need some ATL API that will
execute transformation and return Ecore model.
The dirty way that would work for sure is to write your model to
standard XMI file and later read it in the workflow. I discourage such
solution though.
ps. Xpand can also work with XML Schema as a metamodel and XML as a
model or Java classes as a metamodel and Java objects as model, so it is
quite handy, it allow for M2M on them too (with Xtend which is OCL-like
query language for Xpand).
Regards,
Krzysztof Kowalczyk
|
|
|
Powered by
FUDForum. Page generated in 0.05767 seconds