Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Tansformation with Multiple source models - Single output model(Is it possible to define a transformation with multiple source models and a single output model?)
Tansformation with Multiple source models - Single output model [message #1020534] Mon, 18 March 2013 11:59 Go to next message
Paul Rontidis is currently offline Paul RontidisFriend
Messages: 10
Registered: March 2013
Junior Member
Hello,

I am fairly new to model driven development question and I would really appreciate some help.

Is there a way to have multiple source models (conforming to the same metamodel) as input?
I tried the following but I get error: "Type of transformation parameter should be model type" so I guess a sequence of ASTs is not a valid input parameter.

modeltype AST uses 'AST uri';
modeltype senslmetamodel uses 'DSL uri';

transformation AST2PIM(in selnsAST:Sequence(AST), out PIM:senslmetamodel);


P.S. The same applies to output model. I thought of a workaround: parse all the XMIs into one big XMI and transform it but I think it is not a clean solution.
Re: Tansformation with Multiple source models - Single output model [message #1020689 is a reply to message #1020534] Mon, 18 March 2013 18:21 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI

You have defined an input model that is a Sequence.

If you want multiople input models spercify multiple inputs models and
use the @ to navigate around them

Alternatively rather than define a meg-XMI, define a contents meta-model
that represents your 'Sequence;' and then transform from the contents model.

Regards

Ed Willink


On 18/03/2013 18:12, Paul Rontidis wrote:
> Hello,
>
> I am fairly new to model driven development question and I would
> really appreciate some help.
>
> Is there a way to have multiple source models (conforming to the same
> metamodel) as input?
> I tried the following but I get error: "Type of transformation
> parameter should be model type" so I guess a sequence of ASTs is not a
> valid input parameter.
>
>
> modeltype AST uses 'AST uri';
> modeltype senslmetamodel uses 'DSL uri';
>
> transformation AST2PIM(in selnsAST:Sequence(AST), out
> PIM:senslmetamodel);
>
>
> P.S. The same applies to output model. I thought of a workaround:
> parse all the XMIs into one big XMI and transform it but I think it is
> not a clean solution.
Re: Tansformation with Multiple source models - Single output model [message #1020695 is a reply to message #1020689] Mon, 18 March 2013 18:38 Go to previous messageGo to next message
Paul Rontidis is currently offline Paul RontidisFriend
Messages: 10
Registered: March 2013
Junior Member
Thank you for replying.

Ed Willink wrote on Mon, 18 March 2013 14:21
HI
If you want multiople input models spercify multiple inputs models and
use the @ to navigate around them

Excuse me if I am wrong, do you mean that I should specify something like "(in senslAST1, in senslAST2, ...)?
If this is the case, it is not adequate because I have an arbitrary numbers of input models, not know beforehand.

[Updated on: Mon, 18 March 2013 20:39]

Report message to a moderator

Re: Tansformation with Multiple source models - Single output model [message #1020707 is a reply to message #1020695] Mon, 18 March 2013 19:19 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi<br>
<br>
Which is why the second part of my response suggested a contents
meta-model.<br>
<br>
<i>Alternatively rather than define a meg-XMI, define a contents
meta-model that represents your 'Sequence;' and then transform
from the contents model.
</i><br>
<br>
Please read.<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>
<br>
On 18/03/2013 18:38, Paul Rontidis wrote:<br>
</div>
<blockquote cite="mid:ki7muk$boj$1@xxxxxxxxe.org" type="cite">Thank
you for replying.
<br>
<br>
Ed Willink wrote on Mon, 18 March 2013 14:21
<br>
<blockquote type="cite">HI
<br>
If you want multiople input models spercify multiple inputs
models and use the @ to navigate around them
<br>
</blockquote>
<br>
Excuse me if I am wrong, do you mean that I should specify
something like "(in senslAST1, in senslAST2, ...)? If this is the
case, itis not adequate in my case because I have an arbitrary
numbers of input models, not know beforehand.
<br>
<br>
<br>
</blockquote>
<br>
</body>
</html>
Re: Tansformation with Multiple source models - Single output model [message #1020719 is a reply to message #1020534] Mon, 18 March 2013 19:57 Go to previous messageGo to next message
Adolfo Sanchez-Barbudo Herrera is currently offline Adolfo Sanchez-Barbudo HerreraFriend
Messages: 260
Registered: July 2009
Senior Member
Hi Paul,

QVTo doesn't provide support for an arbitrary number of model
parameters. They need to be know as well as their model types (i.e
metamodels).

As Ed suggested in a different reply, try to create a Metamodel
decorator with just one class (MyASTGroup) and a multi-valued
containment reference whose type is AST.

modeltype AST uses 'AST uri';
modeltype senslmetamodel uses 'DSL uri';
modeltype MyASTGroup uses 'MyASTGroupAST uri';

transformation AST2PIM(in selnsAST:MyASTGroup, out PIM:senslmetamodel);
....

Then your input parameter is just one MyASGroup but it may contain as
many ASTs as you want.

Cheers,
Adolfo.

On 18/03/2013 18:12, Paul Rontidis wrote:
> Hello,
>
> I am fairly new to model driven development question and I would really
> appreciate some help.
>
> Is there a way to have multiple source models (conforming to the same
> metamodel) as input?
> I tried the following but I get error: "Type of transformation parameter
> should be model type" so I guess a sequence of ASTs is not a valid input
> parameter.
>
>
> modeltype AST uses 'AST uri';
> modeltype senslmetamodel uses 'DSL uri';
>
> transformation AST2PIM(in selnsAST:Sequence(AST), out PIM:senslmetamodel);
>
>
> P.S. The same applies to output model. I thought of a workaround: parse
> all the XMIs into one big XMI and transform it but I think it is not a
> clean solution.
Re: Tansformation with Multiple source models - Single output model [message #1021191 is a reply to message #1020534] Tue, 19 March 2013 16:26 Go to previous messageGo to next message
Paul Rontidis is currently offline Paul RontidisFriend
Messages: 10
Registered: March 2013
Junior Member
Thank you for proposing this solution, I created the aggregation ecore and wrote the simple transformation.
For my task to be completed I guess I need to write a simple Java program that creates the ASTGroup instance.
Re: Tansformation with Multiple source models - Single output model [message #1021202 is a reply to message #1021191] Tue, 19 March 2013 16:40 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

If it's a true *.ecore you can use an auto-generated Ecore editor to
give you a Tree Editor for your aggregator.

If you're really over-enthusiastic you can use Xtext to create a
mini-DSL and text editor.

Regards

Ed Willink


On 19/03/2013 16:26, Paul Rontidis wrote:
> Thank you for proposing this solution, I created the aggregation ecore
> and wrote the simple transformation. For my task to be completed I
> guess I need to write a simple Java program that creates the ASTGroup
> instance.
Previous Topic:Memory Leak
Next Topic:[Announce] Eclipse QVT Operational 3.3.0 (Kepler) M6 is now available
Goto Forum:
  


Current Time: Tue Apr 16 05:54:18 GMT 2024

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

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

Back to the top