Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Order of mapped objects
[QVTO] Order of mapped objects [message #519532] Tue, 09 March 2010 09:09 Go to next message
Baptiste Mesta is currently offline Baptiste MestaFriend
Messages: 31
Registered: September 2009
Member
Hi,

I was wondering how to keep my mapped object ordered:
I call my transformation using a list of EObjects and i map them using this code:

form.rootObjects()[FORM::Form]->map form2Xhtml();


But in ouput the order is not the same than in input.
Do you know a way to keep them in the same order as objects in input, or am i doing something wrong?

Anyway thank you for this great tool and, in advance, for any help!

BR,


Re: [QVTO] Order of mapped objects [message #519639 is a reply to message #519532] Tue, 09 March 2010 15:04 Go to previous messageGo to next message
C. Kopf is currently offline C. KopfFriend
Messages: 37
Registered: November 2009
Member
I am not exactly sure if I got it right, did you already tried using "->asOrderedSet()".

Just as following:

form.rootObjects()[FORM::Form]->map form2Xhtml()->asOrderedSet();


Is this what you have been searching for?
Re: [QVTO] Order of mapped objects [message #519656 is a reply to message #519639] Tue, 09 March 2010 15:35 Go to previous messageGo to next message
Baptiste Mesta is currently offline Baptiste MestaFriend
Messages: 31
Registered: September 2009
Member
Hi C. Kopf,

First thank you for your answer.

I tried these:

form.rootObjects()[FORM::Form]->map form2Xhtml();
form.rootObjects()[FORM::Form]->map form2Xhtml()->asOrderedSet();
form.rootObjects()[FORM::Form]->asOrderedSet()->map form2Xhtml();
form.rootObjects()[FORM::Form]->->asOrderedSet()map form2Xhtml()->asOrderedSet();


but the resulting objects are not in the same order than input objects.

My problem is that i'm giving to the TransformationExecutor, inside the "form" argument, a list of EObject with type FORM::Form and i would like to have my output EObject in the same order. (my mapping map 1 object to 1 object of the other type)
But it's not the case. I've seen through my logs that form.rootObjects()[FORM::Form]->asOrderedSet() do not keep the order of my objects.

Do you know any other way to get my objects from the 'form' argument and keep them ordered?


icon9.gif  Re: [QVTO] Order of mapped objects [message #519663 is a reply to message #519532] Tue, 09 March 2010 15:50 Go to previous messageGo to next message
C. Kopf is currently offline C. KopfFriend
Messages: 37
Registered: November 2009
Member
Ah, ok, I see.

The asOrdererdSet method does not make the TranformationExecutor handle the set to be "ordered" but creates some kind of order for the set. so this cannot help you, as you already found out.

I do not yet know how, and in which order the TranformationExecutor processes Sets of EObjects.
Probably it malkes sense to try an explicite forEach-clause? But I do not realy believ this would help. I will try to find out more, sorry for the nonfiting answer above.
Re: [QVTO] Order of mapped objects [message #519681 is a reply to message #519663] Tue, 09 March 2010 16:57 Go to previous messageGo to next message
PBarendrecht is currently offline PBarendrechtFriend
Messages: 36
Registered: November 2009
Location: Eindhoven, Netherlands
Member
It is a bug in the implementation of M2M QVTO if I'm not mistaken. A while ago there was a similar problem:

http:// www.eclipse.org/forums/index.php?t=msg&th=158187&sta rt=0&

I don't know whether you really have to maintain the order of your objects or just wondered why it isn't maintained?
In case it is the first option, you have to change your model until there is a fix... Sad
Re: [QVTO] Order of mapped objects [message #519710 is a reply to message #519681] Tue, 09 March 2010 18:02 Go to previous message
Baptiste Mesta is currently offline Baptiste MestaFriend
Messages: 31
Registered: September 2009
Member
Ok!

Yes i had to make some workarounds ^^

Thank you anyway for your answers Smile


Previous Topic:variables between rules
Next Topic:[ATL] Problem trying to transform uml programmatically
Goto Forum:
  


Current Time: Mon Aug 19 03:25:14 GMT 2019

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

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

Back to the top