Hello again,

Today I thought I'd play around with trying to make some Jess calls in
java, but have run into what seems like a trivial problem that I just
can't figure out:

I am calling a java method from a jess script, and creating a Fact in
that method.
The problem is how to get the current Rete instance?

I.e. In the .clp file:
     ...
     (call ?SomeClassInstance createMyFact)
     ...

In the java code
     ...
     public void createMyFact() {
          Fact f = new Fact("MyTemplate", reteInstance);
          f.setSlotValue("A", new Value(1, RU.INTEGER));
          reteInstance.assert(f);
          }
     ...

Where do I get "reteInstance" from? Most examples simply create one in
Java, but alas I'm starting from an existing engine. I have a feeling
from section 4.3 that Context.getEngine() is involved, but I'm afraid I
have not located an example in the doc.

thank you in advance,

Jack



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