Skip to main content



      Home
Home » Modeling » ATL » how to use lazy rule to output various value
how to use lazy rule to output various value [message #1850253] Tue, 22 February 2022 21:16 Go to next message
Eclipse UserFriend
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 13:09 Go to previous messageGo to next message
Eclipse UserFriend
...
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
    )
}
Re: how to use lazy rule to output various value [message #1850292 is a reply to message #1850283] Thu, 24 February 2022 03:57 Go to previous message
Eclipse UserFriend
thank you
Previous Topic:how to generate emftvm file
Next Topic:ATL question
Goto Forum:
  


Current Time: Mon Nov 03 21:22:24 EST 2025

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

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

Back to the top