Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EGL M2T Transformation and Xtext
EGL M2T Transformation and Xtext [message #1271958] Sun, 16 March 2014 18:24 Go to next message
Luca Gherardi is currently offline Luca GherardiFriend
Messages: 60
Registered: November 2010
Member
Hi all,

I have a simple Ecore Meta-Model which models a library that contains books (it's just a simple example). Both, library and books are characterized by a name.

I wrote a DSL that allows me to do something like this:

SelectedBook BookA
SelectedBook BookB


Where BookA and BookB are books defined in an instance of the ecore meta-model.

I followed this tutorial and I was able to implement the aforementioned DSL. Hence I can import books name for an Ecore model.

Now I need to write a model-to-text transformation that transform the DSL in java code. I'm using Epsilon EGL.
However when I try to access the books within the transformation, the content of their fields (e.g. the string name) is null.

Do you have any idea on how it is possible to fix the problem?
Please let me know if you need further information.

I asked the question in the Xtext forum: http://www.eclipse.org/forums/index.php/f/22/

They helped me in having a solution for reading the ecore elements in a standalone program. But they don't know how to do the same with Epsilon.

Thanks,
Luca
Re: EGL M2T Transformation and Xtext [message #1272448 is a reply to message #1271958] Mon, 17 March 2014 23:57 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 919
Registered: July 2009
Senior Member

Hi,

Could you please provide a minimal example [1] we can use to reproduce this?

Cheers,
Dimitris

[1] http://eclipse.org/epsilon/doc/articles/minimal-examples/
Re: EGL M2T Transformation and Xtext [message #1272839 is a reply to message #1272448] Tue, 18 March 2014 22:38 Go to previous message
Luca Gherardi is currently offline Luca GherardiFriend
Messages: 60
Registered: November 2010
Member
Hi Dimitris,

I made the simple example, I tried to keep it as simple as possible.
You can download it form this link: https://www.dropbox.com/s/jhvo33118le17f2/Archive.zip

You will find the following projects

Library Metamodel and editor:

  • org.library.model
  • org.library.model.edit
  • org.library.model.editor
  • org.library.model.tests


Xtext DSL
Library Metamodel and editor:

  • org.library.xtext.dsl
  • org.library.xtext.dsl.sdk
  • org.library.xtext.dsl.tests
  • org.library.xtext.dsl.ui


Xtext support for importing elements defined in the ecore meta-model (see http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/)

  • org.library.xtext
  • org.library.xtext.ui


Support for the Epsilon transformation: org.librart.xtext.m2t

Epsilon transformation: org.library.transform.service

More in details the transformation is defined in the file 'Epsilon/Library.egl'.

You can run it form the menu 'Library'. It works only if the opened file is a '*.librarydsl'.

For convenience here you can find a project including 2 dummy models (one conforms to ecore and the other to the DSL): https://www.dropbox.com/s/19watg3sfvv2yba/runtime-EclipseXtext.zip

As you can see when you run the transformation, the generated file shows that the proxy is not resolved (first line of each book) and for this reason I cannot access its fields (second line of each book).

This is the Epsilon version: Epsilon Core 1.1.0.201309101707

Let me know if you need further information.

Thanks in advance,
Luca



Previous Topic:Modellink - reproducing screencast problem
Next Topic:How to refer to UML profile within ETL module
Goto Forum:
  


Current Time: Sat Dec 20 13:52:50 GMT 2014

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

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