Hi there, I have a programming question about extracting information from the specific facts that activate a rule. My java program batches a default set of rules and then dynamically 'definstances' Beans into the fact base from a stream of incoming data. After all the facts are loaded (and sometimes during the load if there are a lot of facts) the engine is run. While Jess is running, I need to extract certain information from the facts that trigger the various rules.
My question is, what is the best way to do this: by a) calling a Userfunction in the RHS of the rule that adds the info I need to a vector, and then iterating through the vector when the engine stops running, or b) by trapping events in my event handler and extracting the info I need there at run time. My first intuition is to use the event handler. I trap DEFRULE_FIRED events and pull information directly out of the JessEvent object. This seems to work fine. I also wrote a Userfunction that stores up the fact info I need in a vector from all the rules that have fired. This also works, but I have to wait until the engine stops running to iterate through the vector. Both ways work fine, but I was just curious if anyone sees any major reason to use one over the other. Any performance issues in either method? Thanks very much, - Howard -------------------------------------------------------------------- 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] --------------------------------------------------------------------
