Tutorial | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Downloads
QVT Tutorial - 9
Time to test our transformation! Please make sure that you have completed every section of the tutorial before this one, or just download the complete transformation. I added some extra comments.
Ok, in Eclipse, click on the arrow next to the "Run As..." button:
Choose "Run Configurations...". Double click on "Operational QVT Interpreter":
Below the option you just clicked, a new transformation "MMATransformation" has appeared. On the right, there are three tabs: Transformation, Configuration and Common. Click Transformation (if it's not already opened).
Look for the field with "IN Source". In this field, you should fill in the path to the instance of MMA (so, Instance.mma). Once you have done this, copy the contents of this field to the field below and change "mma" to "mmb". You're now pointing to a non-existing file, but this doesn't matter because QVT will create it itself. Click Apply, and then Close.
Only one thing left now, I don't know how to do this automatically so I'll explain what to do next. In Eclipse, in the "Project Explorer", right-click "Instance.mma", choose "Open With" and Next "Text Editor".
On the second row, search for xmlns:mma="http://mma/1.0", and change it to xmlns:mma="platform:/resource/Tutorial/MMA.ecore". Save it.
Finished! Again, click the arrow next to "Run As..." and click on the newly appeared option "MMATransformation". If you did everything like it should be done, some results from the "log" functions will appear, like "Name of the Automaton: A1".
After the Console indicates "<terminated>" (this should happen in less than a second), right-click on the appeared "Instance.mmb" in the "Project Explorer", and double click on it. This should be the result:
Well, that's it. I hope this tutorial helped you a little to understand QVTO. The part about the metamodels MMA and MMB is now finished.
However there are two additional parts to this tutorial: other useful QVT and OCL functions, and finally something about Parameters and Standalone execution.