[QVTo] Multiple Output Models [message #916589] |
Wed, 19 September 2012 03:50  |
Eclipse User |
|
|
|
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 03:50] by Moderator
|
|
|
|
|
Re: [QVTo] Multiple Output Models [message #922821 is a reply to message #916724] |
Tue, 25 September 2012 07:18   |
Eclipse User |
|
|
|
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 07:49] by Moderator
|
|
|
Re: [QVTo] Multiple Output Models [message #922911 is a reply to message #922821] |
Tue, 25 September 2012 08:48   |
Eclipse User |
|
|
|
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 #923100 is a reply to message #922933] |
Tue, 25 September 2012 11:45  |
Eclipse User |
|
|
|
Hi
I think I'd check org.eclipse.emf.ecore.xmi out of GIT, and add an "if"
test at the head of XMLSaveImpl.saveFeatures so that I can set a
breakpoint on plausible candidates.
Regards
Ed Willink
On 25/09/2012 14:15, Bart Theelen wrote:
> 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 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?
|
|
|
Powered by
FUDForum. Page generated in 0.04432 seconds