[QVTo] Scope of Resolve Expressions [message #916081] |
Tue, 18 September 2012 13:52  |
Bart Theelen Messages: 20 Registered: February 2012 |
Junior Member |
|
|
We have defined a number of transformations over several files and we are experiencing that resolve expressions do not seem to work when the relevant mapping function is defined in a different file. We hope any of you can help us.
To illustrate the problem, a pseudo example is presented below. Consider a QVTo transformation defined in the file 'creation.qvto' as follows:
transformation Creation(in I: InModel, out O: OutModel);
main() {
I.objectsOfType(InModel::Bar)->map create()
}
mapping InModel::Bar::create() : OutModel::Foo { }
We are using the above Creation transformation in a different file as follows:
import Creation;
transformation Transform(in I: InModel, out O: OutModel);
main() {
new Creation(I,O).transform();
O.objectsOfType(OutModel::Foo)->forEach(o) {
var i := o.invresolveone(InModel::Bar);
var j := o.invresolveoneIn(InModel::Bar::create, InModel::Bar)
}
}
Unfortunately, we encounter that the resulting variables i and j are unresolved for each o. Possibly, I am not using the available constructs in the correct way, or even using the correct constructs. Or perhaps the scope of the resolve expressions is limited to the one file in which the involved mapping function is defined. I do hope that the latter is not the case...
Can anyone help?
[Updated on: Tue, 18 September 2012 13:58] Report message to a moderator
|
|
|
Re: [QVTo] Scope of Resolve Expressions [message #916140 is a reply to message #916081] |
Tue, 18 September 2012 15:52   |
Ed Willink Messages: 7635 Registered: July 2009 |
Senior Member |
|
|
Hi
My own attempts at using resolve before becoming a QVTo committer were
not good.
I found the constructs difficult to understand and the QVTo
implementation suspect. The limited capabilities of late resolution were
also unhelpful.
I found creating my own mapping Dict from input to output more
understandable for me. It was obvious what happened when and debuggable
as to what had happened.
Subsequently I tried resolve again and got on a bit better, so I'm
undecided whether my problems were user or tool related.
---
Your pseudo example is close to a complete example.
If you can convert it into a zipped project it may help you or us to
debug the problem.
Regards
Ed Willink
On 18/09/2012 14:52, Bart Theelen wrote:
> We have defined a number of transformations over several files and we
> are experiencing that resolve expressions do not seem to work when the
> relevant mapping function is defined in a different file. We hope any
> of you can help us.
>
> To illustrate the problem, an example is presented below. Consider a
> QVTo transformation defined in the file 'creation.qvto' as follows:
>
>
> transformation Creation(in I: InModel, out O: OutModel);
>
> main() {
> I.objectsOfType(InModel::Bar)->map create()
> }
>
> mapping InModel::Bar::create() : OutModel::Foo { }
>
>
> We are using the above Creation transformation in a different file as
> follows:
>
>
> import Creation;
>
> transformation Transform(in I: InModel, out O: OutModel);
>
> main() {
>
> new Creation(I,O).transform();
> O.objectsOfType(OutModel::Foo)->forEach(o) {
> var i := o.invresolveone(InModel::Bar);
> var j := o.invresolveoneIn(InModel::Bar::create, InModel::Bar)
> }
> }
>
>
> Unfortunately, we encounter that the resulting variables i and j are
> unresolved for each o. Possibly, I am not using the available
> constructs in the correct way, or even using the correct constructs.
> Or perhaps the scope of the resolve expressions is limited to the one
> file in which the involved mapping function is defined.
>
> Can anyone help?
|
|
|
|
Powered by
FUDForum. Page generated in 0.02409 seconds