subobjects() order of elements [message #1032935] |
Wed, 03 April 2013 16:43 |
Paul Rontidis Messages: 10 Registered: March 2013 |
Junior Member |
|
|
Hello,
I was getting very close to completing my QVTo project but I have met an obstacle.
The Stdlib::Element::subobjects() : Set(Element) does not preserve object ordering in Operational QVT version: 3.2.2.v20130128-1651.
I know this is excepted due to the fact that the result type is a Set.
Is there an alternative implementation of subobjects() that preserves the object ordering as defined in the input file (e.g. xmi)?
Best,
Paul
[Updated on: Wed, 03 April 2013 16:45] Report message to a moderator
|
|
|
|
|
|
Re: subobjects() order of elements [message #1033037 is a reply to message #1032964] |
Wed, 03 April 2013 19:48 |
Paul Rontidis Messages: 10 Registered: March 2013 |
Junior Member |
|
|
Hello Ed,
First of all, thank you much for your replies.
Excuse me, but I cannot understand the "ordered navigation" part of your answer.
In my PIM only Methods contain a Body element.
For example, I have a Method element, this Method has a Body and the Body has (as statements) various model objects(Expressions, Ifs, Loops).
Thus, I want to retrieve objects of different type in the order they appear in the XMI.
I don't face the same problem with Properties (ordered reference to Property object) which are mapped first and I retrieve them in the correct order.
I appreciate your help so far.
Best,
Paul
P.S.In my PSM I defined a Statement object as a container for each body object. However, the DSL editor (and thus the automatically generated PIM metamodel) was part of another person's work.
[Updated on: Thu, 04 April 2013 08:26] Report message to a moderator
|
|
|
Re: subobjects() order of elements [message #1033073 is a reply to message #1033037] |
Wed, 03 April 2013 20:39 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi
Consider a real world example.
You want to extract a geographically ordered list of police stations
from an Interpol database that you happen to know is geographically ordered.
You are asking the question, give me all the police stations and
complaining that your respondent gives them to you in alphabetical order.
To get your required ordering you must successively visit each
continent, country, county, town to reach the police stations, at each
level preserving the required geographical order. If at any step you
violate the order you lose it.
Regards
Ed Willink
On 03/04/2013 20:48, Paul Rontidis wrote:
> Hello Ed,
>
> First of all, thank you very much for your replies.
>
> Excuse me, but I cannot understand the "ordered navigation" part of
> your answer.
>
> In my PIM only Methods contain a Body element.
>
> For example, I have a Method element, this Method has a Body and the
> Body has (as statements) various model objects(Expressions, Ifs,
> Loops). Thus, I want to retrieve objects of different type in the
> order they appear in the XMI.
> I don't face the same problem with Properties (ordered reference to
> Property object) which are mapped first and I retrieve them in the
> correct order.
>
> I appreciate your help so far.
> Best,
> Paul
>
> P.S. In my PSM I defined a Statement object as a container for each
> body object. However, the DSL editor -which directly affects the
> extracted xmi- was developed by another person and I am not sure I can
> modify it to alter the PIM.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04535 seconds