[rules-users] Collection in working memory!

vanshi nilu.thakur at gmail.com
Mon Nov 3 02:19:36 EST 2008


Hi all,

I'm new to Drools and have a simple question. In my program I have a
collection A of objects B, and each B object has 30-40 attributes. And the
rule run against these attributes of B. I want to run rules against each
instance of B and I 've close to 45 rules. These rules can be grouped under
3 categories and at a time just 1 group need to be applied for a particular
object....point is that there is no need to blindly run an object against
all rules. Now with this background, I would love to hear what is the best
implementation? 

I have put rules in 3 different DRL file and packaged them into single Rule
base. For inserting the facts in working memory, I'm iterating through
collection and inserting one B object at a time in Working memory and then
firing all rules of any one group (for that I'm using
RuleNameEndsWithAgendaFilter()). How bad is this design? Because I can see
for 100 objects I'm inserting facts in working memory 100 times and then
firing rules 100 times. I can make the top level collection 'A' global(or
insert 'A' in WM) and then iterate over it from the rule file ...would that
be a better solution? 

Would appreciate any input in this regard. Thanks.

-- 
View this message in context: http://www.nabble.com/Collection-in-working-memory%21-tp20298166p20298166.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list