Home » Archived » M2M (model-to-model transformation) » [QVTO]QVTO newbie needs some help here.. :(
[QVTO]QVTO newbie needs some help here.. :( [message #468446] |
Wed, 05 August 2009 14:41 |
Eclipse User |
|
|
|
Originally posted by: kytoz.w.gmail.com
Hi all,
i just created two metamodels "UML.ecore" and "RELATIONAL.ecore" and i
want to use both of them as metamodels for the transformation.
Then i start to write the transformation.qvto and i keep getting the error
that tells me the modeltype can not be found.
i tried to define the modeltype like:
model type uml uses UML;
but also get the error.
what do i need to do if i want that two models work as metamodels for the
transformation? I heard from somewhere that i need to use the extension
point to register the models..but cant find the way to do that.
please help, this problem is killing me :(
thank you very much!
best wishes
aslan
|
|
| |
Re: [QVTO]QVTO newbie needs some help here.. :( [message #478676 is a reply to message #472106] |
Thu, 06 August 2009 11:26 |
Eclipse User |
|
|
|
Originally posted by: kytoz.w.gmail.com
hi Sergey,
thank very much for your help! That means a lot for a beginner.
So after I fixed that issue, I wrote my first .qvto file, i fixed almost
all the errors myself except one. I thought that shouldn't be an error but
it just won't go away... :(
Would you please, please give me another hand and help me to check it out?
I made a screen-printing that included all the codes, 2 metamodels and the
error.
you can see it right here:
http://www.realsao.com/error.jpg
Thank you very much for your help!
best wishes,
aslan
|
|
| | | | | | |
Re: [QVTO]QVTO newbie needs some help here.. :( [message #479510 is a reply to message #478822] |
Tue, 11 August 2009 10:52 |
Sergey Boyko Messages: 171 Registered: July 2009 |
Senior Member |
|
|
Hi aslan ,
See some replies in-line, below.
Regards,
Sergey
aslan wrote:
> I did a simple test for the "nothing transformed" issue:
>
> 1.I created an instance of model simpleuml (my.simpleuml) which contains
> only 1 Model Class as Input and excute the following transformation:
>
>
> modeltype UML uses
> ' http://www.eclipse.org/qvt/1.0.0/Operational/examples/simple uml';
> modeltype RDB uses
> 'http://www.eclipse.org/qvt/1.0.0/Operational/examples/rdb';
>
> transformation Simpleuml_To_Rdb(in uml : UML, out RDB);
>
> main() {
> uml.rootObjects()[UML::Model]->map model2RDBModel();
> }
>
> mapping UML::Model::model2RDBModel() : RDB::Model {
> name := self.name;
> }
>
>
> that works just fine, a .rdb fild came up with 1 Model class in it.
>
>
> 2. I created an instance of model Klasse ('my.klasse') which contains
> only 1 'Klasse' Class as Input and excute the following transformation:
>
>
> modeltype uml uses "platform:/resource/QVT/Klasse.ecore";
> modeltype relational uses "platform:/resource/QVT/Relational.ecore";
>
> transformation Klasse2Relational(in xx : uml, out relational);
>
> main() {
> xx.rootObjects()[uml::Klasse]->map class2table();
> }
>
> mapping uml::Klasse::class2table() : relational::Table {
> name := self.name;
>
> }
>
>
> after that, an .relational file came up BUT!!: it is empty.. there
> should be a Table class in it.. but no.. totally empty..
>
> anyone can give me a hand about this plz?
This can appear because input model (xx:uml) contains no root elements
of uml::Klasse type.
Please, attach your metamodel Klasse.ecore and input model my.klasse so
I can figure out why this is happened.
>
> the metamodels that i created for the 2nd transformation you can see em
> here:
>
>
>
> Thank you!
>
> regards,
> aslan
|
|
| | | | | |
Re: [QVTO]QVTO newbie needs some help here.. :( [message #480017 is a reply to message #479896] |
Thu, 13 August 2009 13:35 |
Sergey Boyko Messages: 171 Registered: July 2009 |
Senior Member |
|
|
Hi aslan ,
Interesting that everything works for you in case predefined metamodels
(RDB, UML) is used.
It might be that the problem is somewhere in project or launch
configuration properties.
Could you please zip and post your qvto project (with all stuff you use
such as metamodels, script, launch configuration being used for script
execution) so I can figure out where the problem is.
Regards,
Sergey
aslan wrote:
> Sergey Boyko wrote on Wed, 12 August 2009 17:00
>> Checked with Relational.ecore. No problems in this case too. Exact one
>> Table was create in output .relational file:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <relational:Table xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:relational="http://relational/1.0"
>> xsi:schemaLocation="http://relational/1.0 Relational.ecore"/>
>>
>> Regards,
>> Sergey
>
>
> hi Sergey,
>
> that means it works just fine on your computer....
>
> It is so strange, why it's just not O.K in my damn eclipse. OMG this
> issue is going to kill me :(
>
> I am running the modeling package of Eclipse from here:
> http://www.eclipse.org/downloads/download.php?file=/technolo gy/epp/downloads/release/galileo/R/eclipse-modeling-galileo- incubation-win32.zip
>
>
> this is not suppost to be a problem right? I am really really confused.
>
> anyway THANK YOU very much for everything you did.
>
> regarts,
>
> aslan
|
|
|
Re: [QVTO]QVTO newbie needs some help here.. :( [message #480078 is a reply to message #480017] |
Thu, 13 August 2009 17:21 |
aslan Messages: 21 Registered: August 2009 |
Junior Member |
|
|
Hi Sergey,
you can download the file here (11.26M):
http://www.realsao.com/workspace+runtime.zip
there are 2 folders:
workspace
runtime-EclipseApplication
and here are the detailed steps that what I did from the beginning, so you can understand the files in the project:
1. open Eclipse, creat an Empty EMF object named "PA", creat the two Metamodels "Klasse.ecore" and "Relational.ecore", then creat the .genmodel for both of em. After that, "Generate All" for both .genmodel.
2. right click on the "PA" project and "run as Eclipse Application" to call the 2nd Instance of Eclipse. In there I created a new QTV project named "QVT". I used "open file" and "save as" to copy the 2 metamodels in the folder "transforms" under project "QVT". And then I created a new Example model of "Klasse": "System.Klasse" and of course the transformation script "Klasse2Relational.qvto" ( the simple one for test)
3. right click on "Klasse2Relational.qvto" and set the run configuration, choose "System.Klasse" as Input and set the name of output and click on "Run".
4.a .relational file came up, but it is empty.
5."my.simpleuml" "UML2RDB.qvto" are also in the transforms folder, they works just fine.
Today I even tested this on a mac laptop from beginning, and the output was also EMPTY....
ps. that would be nice if you could give me your email adress, if that's ok for you you can send a mail to mein: kytoz.w(at)gmail.com
Thank you very much!
regards,
aslan
[Updated on: Thu, 13 August 2009 17:24] Report message to a moderator
|
|
| | |
Re: [QVTO]QVTO newbie needs some help here.. :( [message #480338 is a reply to message #480333] |
Sat, 15 August 2009 11:50 |
Sergey Boyko Messages: 171 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------080809060503050107090801
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi aslan ,
Nice to here that it finally works!
I'd like to provide a few comments on content of "workspace+runtime.zip"
you posted.
The problem with your configuration was in 'System.klasse' file. It
references deployed 'Klasse.ecore' model while .qvto script references
workspace copy of 'Klasse.ecore'. I fixed that by opening workspace
'Klasse.ecore' in "QVTO" plug-in and generating new Klasse dynamic
instance ('Klasse.xmi' file). With the new Klasse instance script starts
to work.
Basically, there are two possibly scenarios how to develop and use
metamodels when referencing them from QVTo script.
First one is to create MM in given Eclipse platform (say developer
platform) and generate Java implementation code there. Then launch new
Eclipse Application (say runtime platform) and engineer QVTo script
here. In that case you'll reference deployed MM using their NsURI,
there's no need to copy MM to runtime platform.
Actually you used that scenario for "QVTO" project. But you copied MM to
"QVTO" plug-in that is redundant. Changing modeltype declarations to
modeltype klasse uses "http://klasse/1.0";
modeltype relational uses "http://relational/1.0";
was absolutely right. As I mentioned above your 'System.klasse' also
references deployed 'Klasse.ecore' model.
Some inconvenience here is that for every change in MM you should
regenerate implementation code for it and relaunch runtime platform so
that change becomes visible for QVTo script.
The other scenario is to use workspace MM (no need for new Eclipse
Application launching).
In such case you have to use metamodel mappings. This can be done from
project's context menu "Properties". There is "QVT Settings / Metamodel
Mappings" section. Press "Add", type Source model URI (usually same as
EPackage NsURI) and browse for workspace .ecore model.
After creating MM mappings you can reference MM from QVTo script just
the same way as in first case (using NsURI), i.e.
modeltype klasse uses "http://klasse/1.0";
modeltype relational uses "http://relational/1.0";
and MM mappings would handle redirection from NsURI to workspace .ecore
model.
Also all changes made to workspace MM become immediately visible to QVTo
script.
You can migrate your "QVTO" plug-in to the second scenario by specifying
metamodel mappings for the plug-in. You can create them yourself or just
copy attached .urimap file to .settings folder in "QVTO" plug-in. After
that the plug-in can be used right in developer platform.
Don't forget to re-create 'System.klasse' dynamic instance.
Regards,
Sergey
aslan wrote:
> hi Sergey,
>
> finally... the problem solved...
>
> i just changed the metamodel declare line to:
>
>
> modeltype klasse uses "http://klasse/1.0";
> modeltype relational uses "http://relational/1.0";
>
>
> then everything works fine. :d
> I want to say thank again, thank you very very much for your help in
> this topic, it really means a lot to me.
>
> Thank you!
>
> best wishes,
>
> aslan
--------------080809060503050107090801
Content-Type: text/xml;
name="org.eclipse.m2m.qvt.oml.mmodel.urimap"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="org.eclipse.m2m.qvt.oml.mmodel.urimap"
<?xml version="1.0" encoding="ASCII"?>
<uriMap:MappingContainer xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:uriMap="http:///www.eclipse.org/m2m/qvt/oml/MModelUriMap/1.0.0">
<mapping sourceURI="http://klasse/1.0" targetURI="platform:/resource/QVT/transforms/Klasse.ecore"/ >
<mapping sourceURI="http://relational/1.0" targetURI="platform:/resource/QVT/transforms/Relational.ecore "/>
</uriMap:MappingContainer>
--------------080809060503050107090801--
|
|
| |
Goto Forum:
Current Time: Wed Feb 05 09:48:19 GMT 2025
Powered by FUDForum. Page generated in 0.04715 seconds
|