Skip to main content


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 11:39 Go to next message
graa is currently offline graaFriend
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 11:41 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
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 11:43 Go to previous messageGo to next message
graa is currently offline graaFriend
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 11:56 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
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 11:58 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
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 11:58]

Report message to a moderator

Re: [ATL] acces to string [message #537996 is a reply to message #537985] Fri, 04 June 2010 12:58 Go to previous message
graa is currently offline graaFriend
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: Tue Mar 19 04:48:47 GMT 2024

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

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

Back to the top