[rules-users] Avoid caching method results within non fact objects

rogelio_sevilla1 rogelio.sevilla1 at gmail.com
Fri Aug 3 10:10:23 EDT 2012


Thanks Laune and Greg,

Yes, I'm pretty positive that the amount of facts are the real problem in my
situation. Currently I have only 3 rules, and the first one is in charge of
creating the previous state from a current fact in case it has not been
created.

If the session receives a current fact for the first time, this rule creates
the previous state object so it can be updated within other rules.

I have something like this (just a example, sorry for typos):

rule "State Generator"
when
  $currentFact : CurrentFact()
  not PreviousFact(id == $currentFact.id)
then
  PreviousFact previousFact = new PreviousFact();
  previousFact.cloneThis($currentFact)
  insert(previousFact)  <-- this takes a lot of time
end


That's why I would really like to avoid inserting these states within the
working memory. When I started storing them in the Wrapper Hash, the
fireAllRules went from 80 seconds of execution to 7 seconds. 

Thanks a lot in advance for your advice.











--
View this message in context: http://drools.46999.n3.nabble.com/Avoid-caching-method-results-within-non-fact-objects-tp4019005p4019017.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list