Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » foreach
foreach [message #1038837] Thu, 11 April 2013 08:03 Go to next message
samar sousou is currently offline samar sousou
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 04:33 Go to previous message
Ronan B is currently offline Ronan B
Messages: 229
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: Thu Jul 24 00:37:17 EDT 2014

Powered by FUDForum. Page generated in 0.03145 seconds