Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] what about two nested "distinct..foreach" ?(what about two nested "distinct..foreach" ?)
[ATL] what about two nested "distinct..foreach" ? [message #842531] Thu, 12 April 2012 11:36
Xiaopu Huang is currently offline Xiaopu Huang
Messages: 1
Registered: April 2012
Junior Member
The following code is on page 42 of ATL User Manual - version 0.7 -

-----------------------------------------------------------------------------

using {
coll : Sequence(String) = Sequence{'Score1', 'Score2', 'Total'};
}
to
tab : Table!Table (
lines <- t_lines
),
t_lines : distinct Table!Line foreach(e in coll)(
id <- coll->indexOf(e),
caption <- line_captions
),
line_captions : distinct Table!Caption foreach(e in coll)(
content <- e
)

-----------------------------------------------------------------------------

the result of this transformation is that each line has a caption.
My question is that how to make each line has three captions if a Line may have 1..* captions?
This question really bothered me for a long time.
Write the code down if poosible, thanks a lot!

[Updated on: Thu, 12 April 2012 11:41]

Report message to a moderator

Previous Topic:[ATL] Transformation failure with model references serialized with absolute paths
Next Topic:Transformation failure
Goto Forum:
  


Current Time: Sat Nov 01 06:22:10 GMT 2014

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

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