Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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
graa is currently offline graa
Messages: 42
Registered: April 2010
Member
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
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 511
Registered: July 2009
Senior Member
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
graa is currently offline graa
Messages: 42
Registered: April 2010
Member
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
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 511
Registered: July 2009
Senior Member
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
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 511
Registered: July 2009
Senior Member
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]

Report message to a moderator

Re: [ATL] acces to string [message #537996 is a reply to message #537985] Fri, 04 June 2010 08:58 Go to previous message
graa is currently offline graa
Messages: 42
Registered: April 2010
Member
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: Thu Apr 17 20:59:37 EDT 2014

Powered by FUDForum. Page generated in 0.01613 seconds