Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » foreach
foreach [message #1038837] Thu, 11 April 2013 12:03 Go to next message
samar sousou is currently offline samar sousouFriend
Messages: 63
Registered: March 2013
Member
hi,
why the distinct and the foreach don't work!! there is a plug in not installed!!

my rule is :
rule EnumColumn {
from
i : XML!Element (
if i.name = 'TableInfoTable'
then
i.getFirstElementByName('Type').getTextValue().startsWith('enum')
else
false
endif
)
using {
items : Sequence(String) =
i.getFirstElementByName('Type').getTextValue().getItemList();
}
to
o : MySQL!EnumColumn (
name <- i.getFirstElementByName('Field').getTextValue(),
type <- 'enum',
isPrimaryKey <-
i.getFirstElementByName('Key').getTextValue() = 'PRI',
null <- i.getFirstElementByName('Null').getTextValue() = 'YES',
defaultValue <- i.getFirstElementByName('Default').getTextValue(),
comment <- i.getFirstElementByName('Comment').getTextValue(),
table <- i.parent,
enumSet <- e1
),
e1 : MySQL!EnumSet (
enumItems <- e2
),
e2 : distinct MySQL!EnumItem foreach(i in items) (
name <- i,
enumSet <- e1

)
}

the error was:
distinct-foreach target pattern elements are deprecated, use lazy rules instead


but how can I do the lazy rule!!

I tried but there is a problem all the time :'(

I need your help.

thank you.
Re: foreach [message #1048266 is a reply to message #1038837] Wed, 24 April 2013 08:33 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi,
Collect the values from MySQL!EnumItem and call a lazy rule for each element in the list.
Regards,
Ronan
Previous Topic:serialisation
Next Topic:Cannot find class in reference model
Goto Forum:
  


Current Time: Fri Apr 26 03:54:37 GMT 2024

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

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

Back to the top