Hi,

i want to store the facts from the rete engine, fire
the rule and load back the previous facts and fire the
rule again.
heres a briefing of what i am doing

1. clone each fact and store it in the arraylist
2. fire the rule. 
3. Assert the fact one by one from the arraylist using
rete.assertFact(fact) method.
4. fire the rule.

The rule is very simple: it modifies a slot of one of
the facts. First time the rule fires properly without
any errors. How ever when the rule fires second time
following exception is thrown.

Jess reported an error in routine Funcall.execute
        while executing (modify ?course1 (professor ABC))
        while executing defrule MAIN::change-professor.
  Message: Error during execution.
        at jess.Funcall.execute(Funcall.java:273)
        at jess.Defrule.fire(Defrule.java:215)
        at jess.Activation.fire(Activation.java:84)
        at jess.Agenda.run(Agenda.java:203)
        at jess.Agenda.run(Agenda.java:183)
        at jess.Rete.run(Rete.java:1097)
        at Test.main(Test.java:32)
Caused by: java.lang.NullPointerException
        at jess.FactList.assignTime(FactList.java:40)
        at jess.Rete.processToken(Rete.java:952)
        at jess.FactList.finishModify(FactList.java:347)
        at jess.FactList.modifyRegularFact(FactList.java:382)
        at jess.FactList._modify(FactList.java:303)
        at jess.Rete._modify(Rete.java:433)
        at jess.Modify.call(Funcall.java:971)
        at jess.FunctionHolder.call(FunctionHolder.java:30)
        at jess.Funcall.execute(Funcall.java:266)
        ... 6 more

I am attaching the .clp file and also the .java file
herewith.
I  guess the problem is occuring as i am asserting the
facts with the rete.assertFact() method. Hence the
rule is not able to modify the fact slots.

How do i put the facts back in the rete engine?

thanks in advance,

sanket.

________________________________________________________________________
Send free SMS using the Yahoo! Messenger. Go to http://in.mobile.yahoo.com/new/pc/

Attachment: Test.java
Description: Test.java

Attachment: test.clp
Description: test.clp

Reply via email to