Home » Modeling » Epsilon » XText compatibility with ETL
XText compatibility with ETL [message #1835177] |
Thu, 26 November 2020 11:58 |
Malvina Latifaj 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 #1835184 is a reply to message #1835178] |
Thu, 26 November 2020 14:44 |
Malvina Latifaj 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.
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
|
|
| |
Goto Forum:
Current Time: Sat Apr 27 11:33:28 GMT 2024
Powered by FUDForum. Page generated in 0.03851 seconds
|