As another poster said, you can form the text of a rule and use
executeCommand() to define it. Redefining a rule of a given name
removes any old rule by the same name. Jess's Java API currently
doesn't have any provisions for defining rules except by forming the
text of the rule and letting Jess parse it.


I think Anup Marwadi wrote:
> 
> 
> hi there,
> i need to create a rule using JAVA API instead of the JESS code embedded in 
> r.executeCommand statement. The reason is that I am dynamically changing the 
> rule depending upon the input from the user and I am pretty sure that JESS 
> does not allow me with that flexibility.
> I really am at loss on how to create rules like the one given below using 
> JESS API. any kind of a help will be much appreciated.
> eg rule:
> 
> (defrule example-3
>     (not-b-and-c ?n1&~b ?n2&~c)
>     (different ?d1 ?d2&~?d1)
>     (same ?s ?s)
>     (more-than-one-hundred ?m&:(> ?m 100))
>     (red-or-blue red|blue)
>     =>
>     (printout t "Found what I wanted!" crlf))
> 
> 
> 
> regards,
> anup
> 
> 
> 
> 
> _________________________________________________________________
> Join the world�s largest e-mail service with MSN Hotmail. 
> http://www.hotmail.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]
> --------------------------------------------------------------------
> 



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

Reply via email to