That's what I thought.
Thank You.

- Howard

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 7:50 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Jess programming question


There's nothing wrong with either approach. It sounds like the
event-based approach is more fail-safe sine it doesn't rely on you
calling anything explicitly from the rules, so I think I'd prefer
that.

I think Greenblatt, Howard wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> 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]
> --------------------------------------------------------------------
> 



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

--------------------------------------------------------------------
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]
--------------------------------------------------------------------



--------------------------------------------------------------------
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