I think Mehta, Chirag (IT) wrote:
> Sorry, One more thing,
> 
> Is there anyway of setting a rule to check after all the facts have been
> asserted???
> 
> A rule with a low salience will fire according to whats on the agenda at
> the current time. I require to check whether or not, after all the facts
> have been asserted, whether or not a certain slot value has a particular
> count?  ( a bit like a "finally" clause for a rule )? The problem I am
> having is that, I need to check whether a count is less than 50 at the
> end of execution. This rule keeps adding an activation record all the
> way up to 50 as more facts are asserted. 
> 


There are several ways, all of which depend on other parts of your
program providing a signal that, in fact, all of the facts have been
added. One is to make the rule in question depend on a pattern like
"(all-facts-asserted)", and then when all the facts are asserted, you
assert an "(all-facts-asserted)" fact, and then the rule will fire.

The other way would be to put the rule into its own module
MY-OTHER-MODULE and do *not* make it an auto-focus rule. Then when you
have asserted all the facts, you can "(focus MY-OTHER-MODULE)" and
then the rule will fire, and focus will return to the original
module. 



---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to