Hi Arti,
I think that the main problem is in your constructor for the new Fact
(JIA p.416). The constructor for Fact takes a two arguments: the
first represents the name of an unordered deftemplate that the Rete
engine should attempt to use. You are passing in "jess state resume"
and the Rete engine is not finding that template. As a default, it
creates an ordered fact of its own. Perhaps Ernest can give you the
gory details, but I changed your assertion (plus a few watch commands)
to:
rete.executeCommand("(assert(jess state resume))");
and got the following trace:
MAIN::init-rule: +1+1+t
MAIN::AssertAnswer: +1+1+1+1+1+t
MAIN::EvaluateAnswer: +1+1+1+1+1+t
==> Focus MAIN
==> f-0 (MAIN::initial-fact)
==> Activation: MAIN::init-rule : f-0
Running...
FIRE 1 MAIN::init-rule f-0
Writing Question
<== Focus MAIN
run() returned ...1
Java received :: Is this a question?
Java Answered :: null
==> f-1 (MAIN::jess state resume)
==> Activation: MAIN::AssertAnswer : f-1
f-0 (MAIN::initial-fact)
f-1 (MAIN::jess state resume)
For a total of 2 facts in all modules.
FIRE 1 MAIN::AssertAnswer f-1
Asserting answer....
==> f-2 (MAIN::answer is <External-Address:java.lang.String>)
Done
.. which hopefully is what you were after. :-D
Cheers,
Jason
-----------------------------------------------------
Morris Technical Solutions LLC
www.morristechnicalsolutions.com
[EMAIL PROTECTED]
phone/fax: 503.692.1088
--------------------------------------------------------------------
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]
--------------------------------------------------------------------