I have a MainInJava program that call the following method (the batched file
contains defclasses (for the beans) and some rules).



private static void postSignalProcessor(Event event, Subject subject) throws
JessException {

Rete rete = new Rete();

// Read in the rules

rete.executeCommand("(batch
kb_jess/phs3_signal/post_signal_change_in_function.clp)");

// Create the Beans here

Event e = event;

Subject s = subject;

// Tell Jess about them using definstance

// equivalent to asserting the facts

Funcall f = new Funcall("definstance", rete);

f.add(new Value("event", RU.ATOM));

f.add(new Value(e));

f.execute(rete.getGlobalContext());

rete.executeCommand("(facts)");



f = new Funcall("definstance", rete);

f.add(new Value("subject", RU.ATOM));

f.add(new Value(s));

f.execute(rete.getGlobalContext());

rete.executeCommand("(facts)");

rete.executeCommand("(run)");

}



Note that the facts calls here, and 2 I place in the batch file (on the RHS
of rules) show a return of 0 facts for these two facts function calls and
two placed in the batch file on the RHS of rules.

Yet the rules fire and produce the expected output which includes reports of
values that are in the bean properties..  I have having trouble figuring out
when the facts are in working memory such that the rule LHS is aware of them
to produce an activation, considering the (facts) returns of 0 facts! As
soon as I declare definstances using the Funcall and execute it, shouldn't
there be a fact in JESS's working memory? I have also tried putting in
(reset) in various places before and after the Funcalls and in the batch
file with the same results.

According to JIA, definstance is similar to deffacts or asserting facts,
which in my experimnets does oproduce a list of facts after such a
declaration.

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