Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] ATL query and for Statement
[ATL] ATL query and for Statement [message #529803] Tue, 27 April 2010 10:09 Go to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Hi,
can I define a for Statement in a ATL query?
How?
thanks
Re: [ATL] ATL query and for Statement [message #529807 is a reply to message #529803] Tue, 27 April 2010 10:22 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You can do the equivalent using helpers (collect, iterate etc..) but you can't use imperative do blocks.
Re: [ATL] ATL query and for Statement [message #529826 is a reply to message #529807] Tue, 27 April 2010 11:38 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
thanks,
but my problem that I have a Set ('A','B'),
and i would like to obtain a result : AA, AB, BB, BA,
how to do that with ATL without for statement ??
thanks
Re: [ATL] ATL query and for Statement [message #529848 is a reply to message #529803] Tue, 27 April 2010 13:10 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
just like with for :

let set : Set(String) = Set{'A','B'} in
set->iterate(e; res : Sequence(String) = Sequence{} |
res.union(set->iterate(f; res2 : Sequence(String) = Sequence{} | res2.append(e + f))))
Re: [ATL] ATL query and for Statement [message #529851 is a reply to message #529803] Tue, 27 April 2010 13:13 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
btw, you can also write to files in classical ATL transformations using writeTo just like in queries.

You'll then be able to use classical imperative do blocks and fors if you're not really comfortable with complex OCL constructs.
Previous Topic:[QVTO] In-place transformation
Next Topic:[ATL]referenced object
Goto Forum:
  


Current Time: Tue Apr 23 09:29:21 GMT 2024

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

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

Back to the top