| Order of Transformation [message #1017286] |
Mon, 11 March 2013 09:42  |
Basma Moukhtar Messages: 22 Registered: June 2010 |
Junior Member |
|
|
Dears,
I use ATL in a simple transformation.
I need to know how to keep the order of the input model elements after the transformation.
for example:
If I have 2 different entities (input_1 and input_2) in the input model need to be transformed to their corresponding 2 output entities (output_1 and output_2).
I will make 2 rules, one to transform each entity as follows:
rule input_1_to_output_1
{}
rule input_2_to_output_2
{}
If the input file is as follows:
<input_1 ></input_1 >
<input_2 ></input_2 >
<input_1 ></input_1 >
The rules will run sequentially (rule 1 then rule 2)writing to the output file and the result will be:
<output_1 ></output_1 >
<output_1 ></output_1 >
<output_2 ></output_2 >
so it transformed all input_1 first then input 2 and this changed the order of lines in the output.
In my problem I need them to be ordered.
How can I solve this?
|
|
|
| Re: Order of Transformation [message #1017750 is a reply to message #1017286] |
Tue, 12 March 2013 09:31   |
Hugo Bruneliere Messages: 467 Registered: July 2009 |
Senior Member |
|
|
Hello,
If model elements have to be ordered, this has to be explicitly specify in the corresponding metamodel, for instance by creating an ordered reference in one class (pointing to instances of other classes).
If your model elements are contained directly at the root of the model or in an non-ordered reference, then it is normal that your case can happen.
Best regards,
Hugo
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
| Re: Order of Transformation [message #1022088 is a reply to message #1021863] |
Thu, 21 March 2013 05:06   |
Hugo Bruneliere Messages: 467 Registered: July 2009 |
Senior Member |
|
|
Of course you can work directly on the Ecore files to specify your metamodels.
KM3 is just a textual notation that is intended to simplify the definition of such metamodels in Ecore, but its use is by no way mandatory.
Hugo
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01664 seconds