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:

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
------------------------------------------

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
------------------------------------------

I tried to solve this problem by making an ordered reference, but this didn't work.

My metamodel is a metamodel for a flowchart.
I have a class called Flowchart which has a reference called nodes to the class Node.
The metamodel is as follows:

And the detailed properties of the nodes reference in class Flowchart is as follows:

And the details of the flowchart reference in class Node is as follows: