Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » [QVTo] Multiple Output Models
[QVTo] Multiple Output Models [message #916589] Wed, 19 September 2012 07:50 Go to next message
Bart Theelen is currently offline 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 #916618 is a reply to message #916589] Wed, 19 September 2012 08:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
Hi

I replied to http://www.eclipse.org/forums/index.php/t/378195/ 16 hours
before your ping.

For multiple output models you're beyond my knowledge and "do not work"
does not help me understand what the problem is
- compile failure
- runtime exception
- hang
- nothing hapens

.....

Regards

Ed Willink



On 19/09/2012 08:50, Bart Theelen wrote:
> 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 assign created objects (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?
>
>
Re: [QVTo] Multiple Output Models [message #916724 is a reply to message #916618] Wed, 19 September 2012 11:15 Go to previous messageGo to next message
Bart Theelen is currently offline Bart Theelen
Messages: 20
Registered: February 2012
Junior Member
I am still studying your answer in the other topic. For this one here, the 'do not work' meant that it is not accepted as valid code... However, I got some answers from my collegues who indicate that I should apparently use the @ symbol in the syntax...
Re: [QVTo] Multiple Output Models [message #922821 is a reply to message #916724] Tue, 25 September 2012 11:18 Go to previous messageGo to next message
Bart Theelen is currently offline 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 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
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 Go to previous messageGo to next message
Bart Theelen is currently offline 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

Re: [QVTo] Multiple Output Models [message #923100 is a reply to message #922933] Tue, 25 September 2012 15:45 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
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?
Previous Topic:QVTo editor with changing input model
Next Topic:QVTo and OCL
Goto Forum:
  


Current Time: Thu Oct 30 16:59:09 GMT 2014

Powered by FUDForum. Page generated in 0.08670 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software