[rules-users] Drools optimization

Quinn, Dan dequinn at fedex.com
Thu Jul 3 11:21:09 EDT 2008


Hello All,

  I am implementing a Rules Engine with Drools that has a fact count in
the millions. I have tried to remove some of the facts from the system
to cut down on my load. To do this, a layer has been place "over" Drools
that filters out facts before they enter the system. 

  This approach helps a bit, but it has introduced a new problem. To
determine which facts should make their way into the system, a large
number a queries are run against working memory. I have placed a fact
counter into my system and it suggests every query is inserted into the
system as a fact. Due to the large number of queries, the fact counter
reported over 400000 fact queries were placed into the system. This
accounts for 40+% of the facts in the system. 
 
  This leads me to a couple of questions. First, is the fact counter
giving me accurate information? Do all of the queries get entered into
working memory, and stay there? Secondly, if all these queries are
entered into the system, and stay there, does it effect performance? If
that's true, are the queries eventually removed, or do I have to do
something explicit to remove them?

  If anyone has other recommendations for optimizing large fact counts
please let me know.

Thanks for your time,
Dan

-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Marcus Ilgner
Sent: Thursday, July 03, 2008 9:24 AM
To: Rules Users List
Subject: Re: [rules-users] insert a collection/ArrayList of facts

On Thu, Jul 3, 2008 at 2:55 PM, thomas kukofka <thomaskukofka at web.de>
wrote:
> Hello,
>
> is it possible to insert an Arraylist of facts like this?:
>
> ArraList list;
> wm.insert (list);
>
> And if yes how can I iterate over the list in the when-part of the
rule?
> The rule should be applied to all elements of the inserted list.
>
> A short drl-example would be perfect.
>
> Kind Regards
> Thomas
>

Hi Thomas,

I'm not sure if this is what you want but I think this should work:

rule "ItemsFromList"
when
  $list : List();
  $item : MyObject() from $list;
then
  // do something
end

Best regards
Marcus
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list