I think =?iso-8859-1?Q?Diego_Alonso_Gonz=E1lez?= wrote:

> 
> Now I'm trying to do it from java, but I am rather new with Jess
>  and I don't get why it doesn't work
> ...
> ValueVector vv= new ValueVector();
> vv.add(new Value("(is-logged (user ?name)(since ?time))",RU.FACT));
> vv.add(new Value("(running (since ?time))"))",RU.FACT));
> 
> Iterator it= mainRete.runQuery("who-is-logged",vv);
> ...


It doesn't work because that's not how to do it :)

There's no public API for building rules or queries in Jess
6. Instead, you can just use executeCommand:

mainRete.executeCommand("(defquery who-is-logged " +
                        "(is-logged (user ?name)(since ?time))" +
                        "(running (since ?time)))");

Iterator it = mainRete.runQuery("who-is-logged", new ValueVector());

The ValueVector would hold the parameters to the query -- i.e., the
arguments that you would pass to run-query in Jess.


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

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