Sorry about the previous post. 

My question is that I am trying to write a Java
program that will use Jess as a rule engine.
Here is what I am doing.....Any help would be
appreciated....

Thanks,
Bob Stewart

The Tester.java file is:
---------------------------------------

import java.io.*;
import java.util.*;
import jess.*;

public class Tester implements Serializable

public Tester()
{}

public static void main(String[] argv)
{

Tester tstr1 = new Tester();
try
{
  Rete r = new Rete();
  r.executeCommand("(watch all)");
  r.executeCommand("(batch /home/rmstew1/jessRules)");
  Fact fact2 = new Fact("a bob stewart", r);
  r.assert(fact2);
  r.executeCommand("(reset)");
  r.executeCommand("(run)");
}
catch (JessException je)
{
  je.printStackTrace();
}
}
}

---------------------------------------

And here is the rules File jessRules:

(defrule rule2
(a ?b ?c)
=>
(printout t "Saw 'a " ?b " " ?c "'" crlf))

---------------------------------------
And here is what happens when I run the program...

%java Tester
rule2: +1+1+1+t
 ==> f-0 (a bob stewart)
 ==> f-0 (initial fact)
%

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.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