Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » iterate
iterate [message #533811] Mon, 17 May 2010 08:11 Go to next message
graa is currently offline graaFriend
Messages: 42
Registered: April 2010
Member
Hi,
i have this helper i would like do iterate through a sequence(goal; w: Sequence{}... but i have an error message when i replace by string it accept. i would have a Sequence as return value.

helper context uml!PackageableElement def :Level0:String =

self.allGoal->iterate(goal; w: String=''|
w+
if (self.allRelationship.includes(Sequence{goal}))then
Sequence{}
else
goal

endif);
can you help me?
thanks
Re: iterate [message #533829 is a reply to message #533811] Mon, 17 May 2010 08:35 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 17/05/2010 10:11, graa a écrit :
> Hi,
> i have this helper i would like do iterate through a sequence(goal; w:
> Sequence{}... but i have an error message when i replace by string it
> accept. i would have a Sequence as return value.
>
> helper context uml!PackageableElement def :Level0:String =
>
> self.allGoal->iterate(goal; w: String=''|
> w+
> if (self.allRelationship.includes(Sequence{goal}))then
> Sequence{}
> else
> goal
> endif);
> can you help me?
> thanks

You must return the type you have declared.
If you declared a String type for the helper, you must return a String.
If you want to return a Sequence, you must declare a Sequence for the
helper...

--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: iterate [message #533844 is a reply to message #533811] Mon, 17 May 2010 09:30 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
helper context uml!PackageableElement def :Level0:Sequence(OclAny)=

self.allGoal->iterate(goal; w: Sequence(OclAny)=Sequence{}|
w.union(
if (self.allRelationship.includes(Sequence{goal}))then
Sequence{}
else
goal

endif));
Previous Topic:exit
Next Topic:[ATL] set something to null (or equivalent)
Goto Forum:
  


Current Time: Mon Dec 09 01:13:08 GMT 2024

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

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

Back to the top