Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] acces to string
[ATL] acces to string [message #537976] Fri, 04 June 2010 07:39 Go to next message
Eclipse UserFriend
hi,

i have the code,it shows a problem that a is undefined ,how i can acces to a and how can i resolve this problem?

if self.GetRelationship2(goal).first().startsWith('And') then Sequence{thisModule.NewEventRefines(Sequence{'(' +(self.GetSupplier((self.GetClientNiveau(goal))->flatten())- >flatten())->iterate(m; a: String=''|
a+('Ev'+m.name +' ||| ')).substring(0,a.size()-3)+')'+' Refines '+ 'Ev'+(self.GetClient(goal))->flatten().first().name})}


thanks
Re: [ATL] acces to string [message #537978 is a reply to message #537976] Fri, 04 June 2010 07:41 Go to previous messageGo to next message
Eclipse UserFriend
In OCL, Strings starts at 1
Re: [ATL] acces to string [message #537983 is a reply to message #537978] Fri, 04 June 2010 07:43 Go to previous messageGo to next message
Eclipse UserFriend
thanks,
but it doesn't resolve the problem
Re: [ATL] acces to string [message #537984 is a reply to message #537976] Fri, 04 June 2010 07:56 Go to previous messageGo to next message
Eclipse UserFriend
at the first execution a is '' so....
Re: [ATL] acces to string [message #537985 is a reply to message #537976] Fri, 04 June 2010 07:58 Go to previous messageGo to next message
Eclipse UserFriend
oh my bad, the substring with a is out of the loop while a is only defined in the context of the iterate; you can't use it outside.
do a :
let string : String = Sequence{thisModule.NewEventRefines(Sequence{'(' +(self.GetSupplier((self.GetClientNiveau(goal))->flatten())- >flatten())->iterate(m; a: String=''|
a+('Ev'+m.name +' ||| ')) in
string.substring(1,string.size()-3)+')'+' Refines '+ 'Ev'+(self.GetClient(goal))->flatten().first().name})}

[Updated on: Fri, 04 June 2010 07:58] by Moderator

Re: [ATL] acces to string [message #537996 is a reply to message #537985] Fri, 04 June 2010 08:58 Go to previous message
Eclipse UserFriend
ok
thank you very much
Previous Topic:[ATL] how to register multiple metamodel with Generic engine
Next Topic:[ATL] Problem with Helper in Rule
Goto Forum:
  


Current Time: Mon Jun 23 11:56:20 EDT 2025

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

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

Back to the top