[QVTo] Multiple Output Models [message #916589] |
Wed, 19 September 2012 07:50 |
Bart Theelen Messages: 20 Registered: February 2012 |
Junior Member |
|
|
Awaiting for an answer on my other question (http://www.eclipse.org/forums/index.php/t/378195/), an alternative solution is to put all transformations in one file. However, that means that I have multiple output models. This would look somewhat like:
transformation Transform(in I: InModel, out O1: OutModel1, out O2: OutModel2);
main() { }
My question is how I can bind created objects (for example, by means of the mapping functions) to either O1 or O2. Assignments like the ones show below do not work.
O1 := I.objectsOfType(InModel::Bla)->map SomeMapping();
O2 := object OutModel2::RootElement { }
Any ideas on how to bind an instance model to the output parameters of a transformation?
[Updated on: Wed, 19 September 2012 07:50] Report message to a moderator
|
|
|
|
|
Re: [QVTo] Multiple Output Models [message #922821 is a reply to message #916724] |
Tue, 25 September 2012 11:18 |
Bart Theelen Messages: 20 Registered: February 2012 |
Junior Member |
|
|
Having solved the multiple output model problem, I run into the next issue...
Next to 10 input models, the transformation has now 3 output models: A, P and M. Model M refers to elements of A and P. At the end of the main function, all the references are correctly realised by the transformation code (which has been checked by printing the involved references), but in the resulting M file, all references to the P file are lost. I have tried reordening the parameters, renaming the parameters in an effort to get M written to file as the last of the three, but none of this helped.
The problem was earlier mentioned in this topic http://www.eclipse.org/forums/index.php/m/675701/#msg_675701 but the solution that is suggested over there does not work in our case...
Any ideas on how to solve this one?
[Updated on: Tue, 25 September 2012 11:49] Report message to a moderator
|
|
|
Re: [QVTo] Multiple Output Models [message #922911 is a reply to message #922821] |
Tue, 25 September 2012 12:48 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
Ordering should not matter, because I would expect all resources in the
ResourceSet to be saved.
My best guess is that one of your relationships is not a containment so
the model gets pruned.
Just possibly a volatile or transient might be involved. Perhaps a
missing nsURI.
Otherwise its a mtter of debugging the XMI save activities.
Regards
Ed Willink
On 25/09/2012 12:18, Bart Theelen wrote:
> Having solved the multiple output model problem, I run into the next
> issue...
>
> The transformation has now 3 output models: A, P and M. Model M refers
> to elements of A and P. At the end of the main function, all the
> references are correctly realised by the transformation code (which
> has been checked by printing the involved references), but in the
> resulting M file, all references to the P file are lost. I have tried
> reordening the parameters, renaming the parameters in an effort to get
> M written to file as the last of the three, but none of this helped.
>
> Any ideas on how to solve this one?
>
> The problem was earlier mentioned in this topic
> http://www.eclipse.org/forums/index.php/m/675701/#msg_675701 but the
> solution that is suggested over there does not work in our case...
|
|
|
Re: [QVTo] Multiple Output Models [message #922933 is a reply to message #922911] |
Tue, 25 September 2012 13:15 |
Bart Theelen Messages: 20 Registered: February 2012 |
Junior Member |
|
|
We also do not expect the order to be important, but the earlier message did suggest that solution so we tried it. Unfortunately, it does not help...
I don't expect it to be a missing containment as both the A and P models are completely & correctly stored in their respective files. Also M is correct until the very last } of the main function. It just does not store the references to P.
I also do not expect a missing nsURI to be the problem as when I create a model by hand with the tree editor after loading the required resources, I can create (and correctly store) an M model that includes the desired references to both A and P models.
Quote:Otherwise its a mtter of debugging the XMI save activities
I hope we don't need to do that, but if so, whereabout / what function should be start looking from?
[Updated on: Tue, 25 September 2012 13:16] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03884 seconds