[rules-users] Is there a way to preventing the Agenda to not match against ALL rules when inserting a fact object

Amit Mhatre ajmhatre at gmail.com
Wed Jun 18 13:20:13 EDT 2008


Hi,
 I am migrating one of my projects to using the drools rule-flow. I have a
bunch of RuleFlowGroups and just 1 fact object (where I am iterating over an
external list and hence I execute the RuleFlow tens of thousands times,
inserting a new fact object for each element in my list). Each RuleFlowGroup
is a logical set of rules that would set a certain variable in the
FactObject and eventually after the flow is executed, the last RuleFlowGroup
will return the outcome based on the variable set by the previous
RuleFlowGroups. I am using a statelessSession.

 The problem I am facing is that when I insert the FactObject into the
workingMemory - then the data points needed by ALL the rules across ALL the
RuleFlowGroups are gathered, i.e. the getter beans for all variables used
across all the RuleFlowGroups are invoked. The activations take place
according to the ruleFlow, but the data is gathered for all the rules
(though my flow might not reach certain groups).

 The thing is, this behavior is not ideal for the task I am working with,
since some of the data points are pretty expensive to be gathered (requiring
expensive queries to be executed). What I'd ideally like is that the data be
gathered only for one RuleFlowGroup at a time, since my rules are structured
such a way that only a fraction of the evaluations should actually need the
expensive data points. The data be gathered for the rules in a ruleFlowGroup
only when that group is active. I understand that this might take a hit for
the efficiency of the matching algorithm, but it would be ideal for my task.

 I've dug through the documentation for AgendaGroups, SequentialMode etc,
but nothing seems to be working for me.

 Has somebody faced a similar problem? Could somebody point me in the
direction I should be following to resolve this? Any help would be greatly
appreciated.

 Thanks,
- am
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080618/57a83f55/attachment.html 


More information about the rules-users mailing list