Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » XText compatibility with ETL
XText compatibility with ETL [message #1835177] Thu, 26 November 2020 11:58 Go to next message
Malvina Latifaj is currently offline Malvina LatifajFriend
Messages: 11
Registered: June 2020
Junior Member
Hi all,

I am currently working on a project where I have to use ETL to write transformation rules between a UML Profile model (class diagram) and an XText model.

I will explain step by step what I did during my first approach.
1. I created a UML Profile and the XText grammar.
2. I generated the corresponding ecore files and I registered them as EPackages.
3. I created a new EMF Model from these packages, one for the graphical part (Papyrus), and one for the textual part (XText).
4. I created two .etl files (one for the transformation framo graphical2textual and the other vice versa), where I added these two models, and wrote the transformation rules.

Everything works.

However I need something else. Now I will explain the steps of what I need to do.

1. Create a UML Profile and XText grammar.
2. Instead of generating the ecore files, and creating EMF models, I will create a UML Profile model (class diagram), and a model for the XText grammar that I have written.
3. From here I need to find a solution to map these two.

I do not know if there is any way to generate these ecore files automatically or something (just an idea), or if there is something else I can which I have not come across yet. How would you proceed in this case?

Please, let me know is anything is unclear!

Thank you!

Re: XText compatibility with ETL [message #1835178 is a reply to message #1835177] Thu, 26 November 2020 12:58 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Malvina,

Both UML models and Xtext-based models are EMF resources so it should just be a matter of replacing your .model files with your UML/textual models in your ETL run configuration.

If this doesn't work, please send us a minimal example [1] we can use to investigate.

Thanks,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/

[Updated on: Thu, 26 November 2020 12:58]

Report message to a moderator

Re: XText compatibility with ETL [message #1835184 is a reply to message #1835178] Thu, 26 November 2020 14:44 Go to previous messageGo to next message
Malvina Latifaj is currently offline Malvina LatifajFriend
Messages: 11
Registered: June 2020
Junior Member
Hi Dimitris,

Yeah, I thought of that. So regarding the UML model, I can do it without generating an ecore, because in the ETL run configuration, when I have to select the type of model that I want to add, I can choose UML model. However, I cannot find a proper solution for XText. I had the same feeling as you, being that these models are EMF resources there should be some solution to this, but I cannot seem to come across one. The type of models that are supported are shown in the following picture.

index.php/fa/39419/0/

So with these type of models, and the Xtext model that I have created, what options do I have? What can I possibly do?

I have come across these topics, which seem to write code in order to generate an XMI or XML file. However, I need that to happen automatically. Let's say when I create or save the XText model, the XML document is also created automatically. This is just one option that came to mind, not sure if you can suggest anything else.

https://www.eclipse.org/forums/index.php/t/292631/
https://www.eclipse.org/forums/index.php/t/1078596/
https://www.eclipse.org/forums/index.php/t/1074913/

Someone else has also provided this solution, but not sure how to integrate it:
https://stackoverflow.com/questions/35839786/xtext-export-model-as-xmi-xml

[Updated on: Thu, 26 November 2020 14:48]

Report message to a moderator

Re: XText compatibility with ETL [message #1835189 is a reply to message #1835184] Thu, 26 November 2020 16:39 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Malvina,

For the Xtext model, you should select "EMF Model" and then in the model file field of the dialog, select your textual Xtext model (e.g. foo.mydsl).

Thanks,
Dimitris
Previous Topic:ETL script, multiple input models
Next Topic:eContainer in abstract syntax
Goto Forum:
  


Current Time: Sat Apr 27 11:33:28 GMT 2024

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

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

Back to the top