[QVTO] Split a target model in several parts [message #97213] |
Thu, 18 December 2008 19:11 |
Eclipse User |
|
|
|
Originally posted by: jbocanegra.uniamazonia.edu.co
Hi.
I have a model "LayerModel" with 3 elements of type Layer: Layer1, Layer2
and Layer3, and I have a QVTO transformation to obtain a "PackageModel"
with three Packages: Pack1, Pack2 and Pack3.
1. Is it possible transform only 2 elements of source model i.e (Layer2 and
Layer3) , parameterizing the Run configurations dialog?
2. Is it possible to obtain two target models, one for the transformation of
Layer2 and other for the transformation of Layer3 ?
Regards.
Jos
|
|
|
Re: [QVTO] Split a target model in several parts [message #97229 is a reply to message #97213] |
Thu, 18 December 2008 22:44 |
Radomil Dvorak Messages: 249 Registered: July 2009 |
Senior Member |
|
|
Hi José,
You can certainly have multiple input models and multiple output models.
It just requires definition of corresponding modeltypes and appropriate
transformation signature.
The code snippet bellow shows how to uses multiple input and outputs of
specific
modeltypes.
....
modeltype ECORE uses "http://www.eclipse.org/emf/2002/Ecore";
modeltype UML uses "http://www.eclipse.org/uml2/3.0.0/UML";
transformation Foo(in inModel1 : UML, in inModel2 : UML, out outModel1 :
ECORE, out outModel2 : ECORE);
main() {
-- select specific objects from a given in model parameter
-- and call a mapping to populate a particular out model
inModel2.rootObjects()[Package]->map rootMaping2();
...
}
mapping UML::Package::rootMaping2() : EPackage@outModel2 {
-- decompose into further mapping calls
}
I hope this helps.
Regards,
/Radek
On Thu, 18 Dec 2008 20:11:41 +0100, Jose Bocanegra
<jbocanegra@uniamazonia.edu.co> wrote:
> Hi.
>
> I have a model "LayerModel" with 3 elements of type Layer: Layer1, Layer2
> and Layer3, and I have a QVTO transformation to obtain a "PackageModel"
> with three Packages: Pack1, Pack2 and Pack3.
>
> 1. Is it possible transform only 2 elements of source model i.e (Layer2
> and
> Layer3) , parameterizing the Run configurations dialog?
>
> 2. Is it possible to obtain two target models, one for the
> transformation of
> Layer2 and other for the transformation of Layer3 ?
>
> Regards.
>
> José
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03004 seconds