[rules-users] 'from global' and the workingMemory

Yoni Mazar y.mazar at gmail.com
Wed Jul 30 04:45:33 EDT 2008


Hi all,

Let's look at the following example:
****DRL file***************
global java.util.List list1;
global java.util.List list2;
rule "r1" when Fact(...) from list1 then ....
****Application************
List<Fact> facts1 = ...
List<Fact> facts2 = ...
List<Fact> allFacts= facts1+facts2

StatelessSession session = ...
session.setGlobal("list1", facts1);
session.setGlobal("list2", facts2);

session.execute(allFacts)
The question: will rule "r1" use the facts from the working memory and a
rete algorithm, or will it naively loop on list1 items?

BTW, can we use generic in the DRL section? for example:
global java.util.List<Fact> list1;

Thanks for the help, Yoni
-- 
View this message in context: http://www.nabble.com/%27from-global%27-and-the-workingMemory-tp18728639p18728639.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list