Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » how to use lazy rule to output various value
how to use lazy rule to output various value [message #1850253] Wed, 23 February 2022 02:16 Go to next message
Yanhong Dong is currently offline Yanhong DongFriend
Messages: 25
Registered: September 2021
Junior Member
When I generate emftvm file, it tell me don't use distinct foreach. so I hope you can teach me how to change?I want to know which way I should iterate over the elements in the array
For this code, how to use the lazy rule to modify? thank you.
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
)
Re: how to use lazy rule to output various value [message #1850283 is a reply to message #1850253] Wed, 23 February 2022 18:09 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

...
using {
coll : Sequence(String) = Sequence{'Score1', 'Score2', 'Total'};
}
to
tab : Table!Table (
lines <- coll->collect(e | thisModule.CreateLine(e, coll->indexOf(e))
)
...

lazy rule CreateLine {
  from
    s : String,
    index : Integer
  to
    t : Table!Line (
      id <- index,
      caption <- thisModule.CreateCaption(s)
    )
}

lazy rule CreateCaption {
  from
    s : String
  to
    t : Table!Caption (
      content <- s
    )
}


Cheers,
Dennis
Re: how to use lazy rule to output various value [message #1850292 is a reply to message #1850283] Thu, 24 February 2022 08:57 Go to previous message
Yanhong Dong is currently offline Yanhong DongFriend
Messages: 25
Registered: September 2021
Junior Member
thank you
Previous Topic:how to generate emftvm file
Next Topic:ATL question
Goto Forum:
  


Current Time: Sat Nov 11 08:17:12 GMT 2023

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

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

Back to the top