I've created a loop in which I read a record from an oracle database,
create a java bean class, set a variable (which has been defclass'd
within a jess file). Then I call reset, Funcall (to call the
definstance
function to pass in the object), then call run.
My question is: am I using the reset properly? I thought that by
calling reset, it would erase the previous definstance, so that the
engine would run only on the current definstance. I put in a (watch
all),
and it is showing that I'm collecting all the instances, and the engine
is firing upon them all each time I call run.
Is there some other way I'm supposed to delete the definstances?
Thanks for any help,
KathyLee Simunich
Decision & Information Sciences Division
Argonne National Lab
----code segment follows-----
for (int i= 0; i < numrecs; i++) {
ccc = (String)fieldReturns[0].get(i); // field from oracle
db
// create the bean
tRec = new TRecord();
tRec.setCCC(ccc);
// assert the facts, and execute manually.
try {
rete.executeCommand("(reset)");
// Tell Jess about the bean
Funcall f = new Funcall("definstance", rete);
f.add(new Value("tRec", RU.ATOM));
f.add(new Value(tRec, RU.EXTERNAL_ADDRESS));
f.simpleExecute(f, rete.globalContext());
// now run on the new definstance
rete.executeCommand("(run)");
} catch (ReteException re) {
re.printStackTrace(nd.stderr());
}
}
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------