[rules-users] Using ArrayList as global in DRL file

Divya Rajendranath divya.rajendranath at gmail.com
Wed Jul 29 06:55:35 EDT 2009


Hi,

I am setting an ArrayList as a Global on my drools session by saying ...

StatefulSession drlSession = getRuleManager().getSession();
drlSession.setGlobal("myMailingList", myMailingList);

then in my Drl file, I send the same arrayList as a parameter to the setter
of another object by saying...

package com.test.rules;

import java.util.ArrayList;

global java.util.ArrayList myMailingList;

rule "Test"
salience 100
no-loop true
when
$o:MyObject(some condition)
$d:Destination()
then
$d.setFieldMember(myMailingList)
end

So, based on some condition/field value in MyObject I want to set the
Destination with the arraylist - myMailingList.

Is the way I specify/refer the ArrayList in the then part fine. Because I am
always getting "unable to compile test.drl file - runtime exception".

Could some one please help me with this.

-thnx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090729/41fbe536/attachment.html 


More information about the rules-users mailing list