On Oct 31, 2006, at 3:52 PM, Skeptic 2000 wrote:


Hi,

I want to have a Java program that can add rules to a Rete object at runtime. The rules would be entered as a String and once added, I would need a way to refer to them on the Java side. What would be the proper way to do it ?

You can just feed the "eval()" method the text of a defrule at any time. eval() will just return TRUE. If you know the name of the rule you added, then you can find the Defrule object with the Rete.findDefrule() method. If you don't know the name of the rule before you add it, then you could use the Jesp parser class directly, calling parseDefrule() to parse the rule. It returns the Defule itself.

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

Reply via email to