Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » QVTo transformation with Xtext target models
QVTo transformation with Xtext target models [message #1857003] Thu, 12 January 2023 14:02 Go to next message
John Henbergs is currently offline John HenbergsFriend
Messages: 239
Registered: October 2020
Senior Member
Hi,

I am writing some QVTo transformations for (UML -> Xtext) instances.
The issue I am encountering is that the generated target models are generated as XMI and not serialised as Xtext files. I tried even just one single mapping rule, and the result is still the same (xmi).
Then I tried to erase what was generated in that file and write something conforming to the xtext grammar, and when I try to write something myself it works fine (conforms to the xtext grammar), but when I generate it, it does not. Any idea on what it might be, or at least how I can understand what might be going wrong? Thank you!
Re: QVTo transformation with Xtext target models [message #1857005 is a reply to message #1857003] Thu, 12 January 2023 14:12 Go to previous messageGo to next message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 115
Registered: April 2011
Senior Member
Hi John

Probably a duplicate of this thread: https://www.eclipse.org/forums/index.php?t=rview&goto=1856671

Without a repro, that problem will be hard to solve. Which file extension do you specify for your target models? Do you run the transformation programmatically (Eclipse or standalone) or manually using QVTo's launch configurations?

Kind regards
Christopher
Re: QVTo transformation with Xtext target models [message #1857012 is a reply to message #1857005] Thu, 12 January 2023 20:15 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The Xtext serializer should work automatically when you use the appropriate extension; as you have found.

But the serializer can fail with a fairly verbose and fairly informative exception when the auto-generated model does not comply with a regular generation.

I spent many 'pleasant' hours debugging for OCL and QVTd serialization. I think I eventually agreed that the serializer was correct each time. Debugging can be assisted by saving first to a *.xmi file before the *.xtext. This gives you an XMI file to study wrt the exception.

While you are getting your 'eye in' on the exception message, you may find it helpful to do a side-by-side comparison of the XMI for small examples; forward-Xext versus your programatic-generation. This will enable you to understand the multiplicities in the diagnostics; it is nearly always a multiplicity bug, but sometimes it's ancestry.

Regards

Ed Willink

[Updated on: Thu, 12 January 2023 20:27]

Report message to a moderator

Re: QVTo transformation with Xtext target models [message #1857038 is a reply to message #1857012] Fri, 13 January 2023 19:40 Go to previous messageGo to next message
John Henbergs is currently offline John HenbergsFriend
Messages: 239
Registered: October 2020
Senior Member
Hi,

Attached to this reply I am sending a repro, with a very simple example where starting from a UML Model which only has a package, by writing QVTo transformations I am trying to convert it to a .myDsl file conforming to an Xtext grammar, in which I have defined Package as a concept.

My work is much bigger, but this happens even with this simple example. In the repro you can find the Xtext files, and a folder named "TestTransformations" which should be imported in the runtime instance. My.uml is the source model and TestTransformation.xmi and TestTransformation.myDsl are the target models that are an output of running the QVTo transformation. I have also included the launch configuration file.

Thanks for any help!

[Updated on: Fri, 13 January 2023 19:47]

Report message to a moderator

Re: QVTo transformation with Xtext target models [message #1857040 is a reply to message #1857038] Fri, 13 January 2023 20:15 Go to previous message
Christopher Gerking is currently offline Christopher GerkingFriend
Messages: 115
Registered: April 2011
Senior Member
Hi John

The file extensions are case-sensitive. Your workflow registers the mydsl extension, while your launch configuration produces a myDsl file. Changing the launch configuration to mydsl, I receive a target file including the string "test".
I assume that you got your setup right, so all the MyDSL projects must be running plugins inside a runtime Eclipse to enable the Xtext support (placing them as projects in your workspace won't be sufficient for serialization).


Kind regards
Christopher
Previous Topic:Transform UML models with applied profile
Next Topic:Output model into separate files
Goto Forum:
  


Current Time: Fri Apr 19 03:52:46 GMT 2024

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

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

Back to the top