Michael Neale <michael.neale <at> gmail.com> writes:

> 
> No I don't think there has been much discussion in it in Drools 3 (but feel
> free to start one ! thats what this list is for).
> 
> But on the topic of what you want: you want some "calculation" to be
> performed once, and the results of that calculation used in subsequent
> rules. This is a reasonably common thing. What I would suggest trying is to
> create an object specifically to hold the results of that "calculation"
> (which is just pulling things out of  a list). You can then bootstrap that
> calculation by having a rule with higher salience take the ShoppingList,
> extract the vitamins, and assert them to the rule engine as a seperate
> object (VitaminList??).
> 
> You can then have other rules depend on that vitamin list being there. That
> way all the rules that depend on vitamin list will be able to be checked,
> yet the list is only calculated once (which will always happen first).
> Further down the track you may have a rule that changes that vitamin list,
> thus requiring the rules to be evaluated again, so its not a bad approach to
> try.
> 
> Michael.
> 
> ---------------------------------------------
> 




Yes, holding the results of custom function calls in intermediate objects is
certainly the way to go about while dealing with computed temporary values.

But initialization call still needs to be done from a  bootstrapping rule seems
to be a very unnatural way of doing it. Well may be we can look forward to
seeing such features like initialization calls,destruction calls etc futute
versions 


Regards
Jayaram



Reply via email to