Hi there,

I had a similar question, to quote a reply I received from Dr. F-H :

" There's no built-in function to do it, but it's easy enough to do
something like this: "

(deffunction save-rules (?file)
   (open ?file "myfile.txt")
   (bind ?it ((engine) listDefrules))
   (while (?it hasNext)
       (printout ?file (ppdefrule ((?it next) getName)) crlf crlf))
   (close ?file))


Matt: The Jess function list is a good place to start, have a look at the "open" and other commands to see how they work. You may also want to become familiar with the java.util.Iterator class.

http://www.jessrules.com/jess/docs/70/functions.html

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Iterator.html


Cheers,
Matt




On 4/18/06, ahmad Sayed < [EMAIL PROTECTED]> wrote:
Hello,
Given a clp file containing a list of rules  (defrule  rule-1....),   What is the simplest way to add another rules to this file from a java code?  I guess that r.execudeCommand("(defrule...") execute it but don't add rules to the file and save changes...
Thank u
 


Blab-away for as little as 1ยข/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.




--
Matthew Hutchinson
Ph.D. Candidate
Department of Spatial Sciences
Curtin University of Technology
GPO Box U1987
Perth, Western Australia 6845

Visiting Scholar
Department of Geography and Planning
University of Akron
Akron, Ohio USA

Reply via email to