In Drools Rules, how to use two different ArrayList objects,obj1 is used in rule 1 and obj2 used in rule2?
Posted
by
Jenn
on Stack Overflow
See other posts from Stack Overflow
or by Jenn
Published on 2009-10-23T18:18:45Z
Indexed on
2012/11/25
5:04 UTC
Read the original article
Hit count: 229
I am doing ksession.insert(list) and after that I have to fire rule 1 in the drl file, then ksession.insert(list) and fire rule 2 in the drl.
Could someone tell me how to achieve this. I read about agenda filters and facthandles but do not really know how to get this to work
Below is some code:
ArrayList list = new ArrayList(); list.add(product1); list.add(product2); list.add(product3);
ksession.insert(list);
ksession.fireAllRules("fire rule 1 in drl");
//remove list?
ArrayList list2 = new ArrayList(); list2.add(str1); list2.add(str2); list2.add(str3);
ksession.insert(list2); ksession.fireAllRules("fire rule 2 in drl");
© Stack Overflow or respective owner