Home » Archived » M2M (model-to-model transformation) » [QVTo] Transforming a relation to a already transformed Element(How to transform a relation to an already transformed element.)
| | | | | | |
Re: [QVTo] Transforming a relation to a already transformed Element [message #521437 is a reply to message #519653] |
Wed, 17 March 2010 11:32   |
Eclipse User |
|
|
|
Hi P.,
thanks for your offer , but I do not think that I am allowed to send the whole project or even just a single complete file to anyone outside the consortium, even so I would like to, sorry.
However, as written before there is a chance that the problem is already located either in the source model, the metamodel-xml-description (ecore, emf and all this) or in the rich-client-plattform (some problems with saving changes in both, the source- and the target-model) i am using. I shall inspect the source code of all three to find out what is not working as wished. This will take some time, but if I find anything of interest I will let you know.
Your notices about conditional resolvings match my observations. I simply get the same result when using the statement without any condition clause.
If this is a bug of the QVTo-Implementation it is somehow significant. As I already mentioned I need to realize a one-on-one resolve where there exist several objects of the Type Port. To identify the "correct" one, I need some kind of condition, don't I?
|
|
|
Re: [QVTo] Transforming a relation to a already transformed Element [message #521814 is a reply to message #519653] |
Thu, 18 March 2010 15:17   |
Eclipse User |
|
|
|
Hi C,
Quote: | ...but I do not think that I am allowed to send the whole project or even just a single complete file to anyone outside the consortium, even so I would like to, sorry.
|
I understand it, I know the problem .
Yep, a thorough inspection of your input model could be useful. Do you get any results at all when you run the transformation? You can test whether the transformation reaches certain mappings by adding log("text").
If there are no results, the problem could be the URI of the metamodel in the input model, see page 9 of the tutorial .
Hmm, I just tested the conditional resolvings again, they suddenly work. Maybe I configured something wrong last time, weird.
However, if it still doesn't work you could add some OCL commands like ->select or ->selectOne. It seems this last function only needs a condition, like this:
targetMode := self.targetLocation.resolve(Mode)->selectOne(m|m.Name.startsWith("S"));
I think there is actually a difference between selectOne and resolveOne with a condition: resolveOne returns the last object of a list, while selectOne returns the first (I think):
targetMode := self.targetLocation.resolveone(m:Mode | m.Name.startsWith("S"));
Well, good luck figuring out the problem
|
|
|
Re: [QVTo] Transforming a relation to a already transformed Element [message #523525 is a reply to message #519653] |
Fri, 26 March 2010 13:10  |
Eclipse User |
|
|
|
Hi P.,
thanks for your input.
I had to work in a different project for a week, so this answer is pretty late, sorry.
I figured out that there was a problem in the rich-client-platform I am using, some issue with saving changes in models and so on. This is fixed now.
But still, none of the resolve functions returns the needed result.
I also tried your idea with using the selectOne-function, still no result at all, the resolve did not work which actually means that there is nothing to select.
I also expect I need a late resolving, but this does not work with the selectOne-function does it?
when using the following code a get a warning, which says:
Quote: | The result of ''late resolve'' must be assigned to a property or non-local variable to execute as deferred assignment
|
here is the code used:
uses := self.interface.oclAsType(ComInterface).late resolve(Port)->selectOne(p|p.name.match(self.interface.shortName));
I am still checking the metamodels but i do not expect that there is an issue with them.
I also found out that all other mappings etc. work pretty fine (via logs and stuff like this).
by the way, is there a possibility to call late resolved values/objects in a log-statement? When simply calling a resolve function in a log-statement the warning, as seen above, occures, and here I understand what it means but anyway it would be very helpful, so probably anyone knows a way to do it?
Thanks again and have a nice weekend.
Cheers,
Chris
|
|
|
Goto Forum:
Current Time: Wed Jul 23 09:56:00 EDT 2025
Powered by FUDForum. Page generated in 0.04984 seconds
|