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

Marcus Ilgner marcus.ilgner at gmail.com
Thu Jul 3 09:23:55 EDT 2008


On Thu, Jul 3, 2008 at 2:55 PM, thomas kukofka <thomaskukofka at web.de> 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



More information about the rules-users mailing list