[rules-users] insert a collection/ArrayList of facts

2008-07-03 Thread thomas kukofka
Hello,

is it possible to insert an Arraylist of facts like this?:

ArraList list;
wm.insert (list);

And if yes how can I iterate over the list in the when-part of the rule?
The rule should be applied to all elements of the inserted list.

A short drl-example would be perfect.

Kind Regards
Thomas
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] insert a collection/ArrayList of facts

2008-07-03 Thread Marcus Ilgner
On Thu, Jul 3, 2008 at 2:55 PM, thomas kukofka [EMAIL PROTECTED] wrote:
 Hello,

 is it possible to insert an Arraylist of facts like this?:

 ArraList list;
 wm.insert (list);

 And if yes how can I iterate over the list in the when-part of the rule?
 The rule should be applied to all elements of the inserted list.

 A short drl-example would be perfect.

 Kind Regards
 Thomas


Hi Thomas,

I'm not sure if this is what you want but I think this should work:

rule ItemsFromList
when
  $list : List();
  $item : MyObject() from $list;
then
  // do something
end

Best regards
Marcus
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users