I think Dennis Brown wrote:
> 
> Hi, I'm new. I've looked over the documentation and some of the
> mailing list archive, and I can't figure out how to do something:
> I want to define rules and queries as Java objects using the Jess
> API,

It can't be done in Jess 6 and earlier. There's no public API for rule
creation. This has been deliberate; if Jess had to support a stable
public API for rule creation, this would have limited how Jess could
evolve.

Note that this is changing with the upcoming 7.0 release, which does
have such an API.

As to how to do what you want in Jess 6: Let's say you have an object
of type Foo, and you want a rule to match if this particular object is
the single datum in an ordered "some-fact" fact. You could do it
like this: 

Rete engine = ...
Foo foo = ...
engine.store("FOO", foo);
engine.executeCommand("(defrule find-foo (some-fact =(fetch FOO)) => )");



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