Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » From generated model to text
From generated model to text [message #102122] Fri, 20 March 2009 12:10 Go to next message
Marion is currently offline MarionFriend
Messages: 2
Registered: July 2009
Junior Member
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 #102151 is a reply to message #102122] Fri, 20 March 2009 13:35 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080105080805050408050503
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Marion,

I don't know JET enough to help you with it, but for such needs you can
look at all projects of the m2T project. Acceleo (
http://www.eclipse.org/modeling/m2t/?project=acceleo ) allows you to use
OCL to query your model and access links as you would in ATL. Do not
hesitate to ask about any of thesse projects on the eclipse.modeling.m2t
newsgroup.

Laurent Goubet
Obeo

Marion a
Re: From generated model to text [message #102181 is a reply to message #102122] Fri, 20 March 2009 17:12 Go to previous messageGo to next message
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
> 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

Good option is Xpand, you can check how it works on
http://www.openarchitectureware.org/pub/videos/00-helloWorld .wmv

Xpand can be found here http://www.eclipse.org/modeling/m2t/
but for Eclipse earlier than 3.5 I would recommend version from
http://www.openarchitectureware.org

Regards,
Krzysztof Kowalczyk
Re: From generated model to text [message #102216 is a reply to message #102181] Mon, 23 March 2009 15:51 Go to previous messageGo to next message
Marion is currently offline MarionFriend
Messages: 2
Registered: July 2009
Junior Member
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?
Re: From generated model to text [message #102232 is a reply to message #102216] Mon, 23 March 2009 17:26 Go to previous message
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
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
Previous Topic:[ATL] Several problems
Next Topic:[QVTO] Some issues with M6
Goto Forum:
  


Current Time: Sat Apr 27 01:54:07 GMT 2024

Powered by FUDForum. Page generated in 0.04338 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top