Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] subobjects() order
[QVTO] subobjects() order [message #499413] Sun, 22 November 2009 04:17 Go to next message
Ioan Salau is currently offline Ioan SalauFriend
Messages: 69
Registered: July 2009
Location: Toronto
Member

I have a metamodel which is similar with XSD metamodel. As in XSD, Sequence can contains a collection of Element, Sequence, Choice, All and in my case few other components. I would like to process these child components in the same order as they are in the input file but when I execute something like this:



mapping SequenceType::sequenceToTemplateParticles(in templateName:String) : XSDContaniner {
log("invoking SequenceType::sequenceToTemplateParticles() " );
containerType := CONTAINER_TYPE::SEQUENCE;
particles += self.subobjects()->map toTemplateParticles(templateName);
}

mapping OclAny::toTemplateParticles(in templateName:String) : Particle
disjuncts ChoiceType::choiceToTemplateParticles, SequenceType::sequenceToTemplateParticles, ElementType::elementToTemplateElement, EllipsisType::ellipsisToTemplateElement, EllipsisType::ellipsisToTemplateElements {
}

.....

Everything works fine, except every time I run the transformation the order is different then the source Sequence model. What should I do the preserve the order during processing/mapping?

Any help is greatly appreciated.

Thanks,

Ioan


Re: [QVTO] subobjects() order [message #499462 is a reply to message #499413] Sun, 22 November 2009 19:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Ioan,

If you take a look into the OMG spec, you can see that the subobjects
operation has
the following signature:

Element::subobjects() : Set(Element)

The Set being the return type here does not give any assumptions on
ordering.
Though, I agree, it's fairly impractical to give a different order
of contained elements then they really have in its container.

We will provide a fix, ensuring that the order is preserved.

Regards,
/Radek



On Sun, 22 Nov 2009 05:17:16 +0100, Ioan <ioan.salau@insighteck.com> wrote:

> I have a metamodel which is similar with XSD metamodel. As in XSD,
> Sequence can contains a collection of Element, Sequence, Choice, All and
> in my case few other components. I would like to process these child
> components in the same order as they are in the input file but when I
> execute something like this:
>
>
>
> mapping SequenceType::sequenceToTemplateParticles(in
> templateName:String) : XSDContaniner {
> log("invoking SequenceType::sequenceToTemplateParticles() " );
> containerType := CONTAINER_TYPE::SEQUENCE;
> particles += self.subobjects()->map toTemplateParticles(templateName);
> }
>
> mapping OclAny::toTemplateParticles(in templateName:String) : Particle
> disjuncts ChoiceType::choiceToTemplateParticles,
> SequenceType::sequenceToTemplateParticles,
> ElementType::elementToTemplateElement,
> EllipsisType::ellipsisToTemplateElement,
> EllipsisType::ellipsisToTemplateElements {
> }
>
> ....
>
> Everything works fine, except every time I run the transformation the
> order is different then the source Sequence model. What should I do
> the preserve the order during processing/mapping? Any help is greatly
> appreciated.
>
> Thanks,
>
> Ioan
>
>
Re: [QVTO] subobjects() order [message #499463 is a reply to message #499462] Sun, 22 November 2009 19:58 Go to previous messageGo to next message
Ioan Salau is currently offline Ioan SalauFriend
Messages: 69
Registered: July 2009
Location: Toronto
Member

Thanks Radek,
I will be looking forward for the fix.

Regards,
Ioan
Re: [QVTO] subobjects() order [message #514601 is a reply to message #499462] Mon, 15 February 2010 22:41 Go to previous message
Ioan Salau is currently offline Ioan SalauFriend
Messages: 69
Registered: July 2009
Location: Toronto
Member

I am wondering if there is a fix for proper order of subobjects() Set.

Thanks,

Ioan
Previous Topic:[ATL] XSD based model as ATL input
Next Topic:[ATL] Transformations with ATL 3.0.0 and 3.0.1
Goto Forum:
  


Current Time: Tue Oct 22 14:45:10 GMT 2019

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

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

Back to the top