Hi I'm building an application wich main() is in Java and that loads in
runtime an script of Jess in a Rete object. Some beans are passed as facts
to rete in this way:

            for(int i=0;i<myMemory.size();i++)  {
               objInMemory = myMemory.recoverObject(i);
               f = new Funcall("definstance", rete);
               f.add(new Value("element", RU.ATOM));
               f.add(new Value(objInMemory));
               f.execute(rete.getGlobalContext());
            }

Immediatly after this the program executes:

            rete.run();

Some rules are fired and the results are recovered using store and
fetch commands. Finally the program clear the facts and storage in this
way:

               rete.executeCommand("(undefinstance *)");
               rete.clearStorage();

The program executes several times the previous part of code until a
variable don't be true. The program begins running perfectly but in some
part, with apparently no reason, the rete object seems to be dead because
I don't recover nothing in the storage, the rules in the script are simple
and are fixed to always return something in the storage (indeed with the
idea of check it I only have 6 simple rules in the script without
chaining). I am sure that I'm not losing the reference of the rete object.
Am I doing something bad in the code showed previously? or Do you have any
idea or suggestion about what is happening?

On the other hand, Is it valid to use assert and retract commands in the
script and in the java program? For example, taking as base the previous
code, after the run method I retract and assert some facts according with
the results obtained in the storage. I dont think that this have problems
but I'm not sure...

Thank you very much...
 
Calicrates...

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