Anything gathered using the "from" keyword will not use the rete algorithm to
determine whether refetching is appropriate or not. (i.e. no awareness of whether the
fetched data is constant for a given fact.) Whenever a "from" condition is
encountered the fetch is performed, so use it with care if efficiency is a concern.
--- On Tue, 2/9/10, Brice Figureau <brice+drools(a)daysofwonder.com> wrote:
From: Brice Figureau <brice+drools(a)daysofwonder.com>
Subject: [rules-users] Rules writing best practice?
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Date: Tuesday, February 9, 2010, 3:40 AM
Hi,
Is there a rules writing best practice document somewhere?
I'm asking the question because as a newbie rule writer
(which doesn't
know anything about the underlying drools matching
algorithm), I'm
wondering if my rules will behave gracefully.
For instance, I (ab)use a lot the from/accumulate to bring
in the
knowledge some external facts coming from some DAO.
All my rules use one time or more the same "from
dao.getInformationFromDatabase( <inserted fact> )"
structure and I'm not
sure the algorithm is smart enough to cache this
information which is
constant for a given inserted fact.
Should I instead insert all this information as facts prior
to the rules
firing?
--
Brice Figureau
My Blog:
http://www.masterzen.fr/
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users