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

Wolfgang Laun wolfgang.laun at gmail.com
Wed Jul 29 07:45:01 EDT 2009


Does your Destination class have a field "FieldMember"?
-W

2009/7/29 Divya Rajendranath <divya.rajendranath at gmail.com>

> 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
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090729/95f0a506/attachment.html 


More information about the rules-users mailing list