On Jan 9, 2008, at 7:40 AM, Nice Bright wrote:
How can I get all the results after running a rete engine? In the other words, I want to get all the fires rules after the running of engine into an iterator (if there is any fired rules ). In the following code after running engine, if the number of fired rules is greater than 0, I am looking for a method call in rete class that helps me to get the list of fired rules.
There's no way to get the (potentially infinite) list of fired rules after they've fired, because Jess doesn't store this kind of history information; but you can get Jess to tell you about each rule as it fires, so you can save the history information yourself. Use the "JessListener" facility with an event type of JessEvent.DEFRULE_FIRED, and your listener will be notified each time a rule fires. You could then save whatever information you want out of each event into a List. See http://herzberg.ca.sandia.gov/jess/ docs/70/library.html#events for info on JessListeners.
--------------------------------------------------------- Ernest Friedman-Hill Informatics & Decision Sciences Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com -------------------------------------------------------------------- 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] --------------------------------------------------------------------
