Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Dynamic set of input models
icon5.gif  Dynamic set of input models [message #1370873] Wed, 21 May 2014 05:54 Go to next message
Sama Elrawy is currently offline Sama ElrawyFriend
Messages: 9
Registered: February 2014
Junior Member
Hello,

In operational QVT, can I take a array of in models as an input of my transformation? knowing that every time I run the transformation I want to use different number of input models.

I mean.. to define a transformation, you define your input/output models. In this example I have 2 in models and 1 out model:

transformation xTransformation(in y:featuremodelview, in z:featuremodelview,out target:featuremodelview);


However, in my transformation I want the input to be a set of in models that may vary in size each time I run the transformation. (so, when I run it for the first time I'll take 2 in models .. when I run it for the second time I'll take 3 in models and so on...)

Note: My transformation merges all the input models regardless of how many of them I have.

Thank you very much in advance, I appreciate your help!

[Updated on: Wed, 21 May 2014 05:58]

Report message to a moderator

Re: Dynamic set of input models [message #1371188 is a reply to message #1370873] Wed, 21 May 2014 08:56 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

No, but it would be nice if a Collection of models could be defined.
Raise an OMG issue: http://www.omg.org/report_issue.htm

The workaround is define a Model-of-Models model so that you can pass
multiple models wrapped as a single model.

Regards

Ed Willink

On 21/05/2014 06:54, Sama Elrawy wrote:
> Hello,
> In operational QVT, can I take a array of in models as an input of my
> transformation? knowing that every time I run the transformation I
> want to use different number of input models.
>
> I mean.. to define a transformation, you define your input/output
> models. In this example I have 2 in models and 1 out model:
>
>
> transformation xTransformation(in y:featuremodelview, in
> z:featuremodelview,out target:featuremodelview);
>
>
> However, in my transformation I want the input to be a set of in
> models that may vary in size each time I run the transformation. (so,
> when I run it for the first time I'll take 2 in models .. when I run
> it for the second time I want to get 3 in models and so on...)
>
>
> Thank you very much in advance, I appreciate your help!
Re: Dynamic set of input models [message #1404311 is a reply to message #1371188] Thu, 31 July 2014 07:41 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
When running the transformation from the run-transformation menu, indeed you can only select one input resource. By default, with EMF editors you can only create one root in the resource, however, EMF supports multiple roots in one resource. Programmatically you can create multiple roots.

Furthermore, if you run the transformation from java, you get access to the model-extends that are input of the transformation. These model-extends can be filled with multiple models. Then you can input models from multiple resources to the QVTo-transformation.
Re: Dynamic set of input models [message #1419180 is a reply to message #1404311] Mon, 08 September 2014 08:03 Go to previous message
Sama Elrawy is currently offline Sama ElrawyFriend
Messages: 9
Registered: February 2014
Junior Member
I got the idea Mr. Rolf! thank you very much.
Previous Topic:Run exported transformation
Next Topic:Running QVTo in a web-based application
Goto Forum:
  


Current Time: Thu Mar 28 09:14:14 GMT 2024

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

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

Back to the top