Following my last post regarding web-based applicatio,
Now the Jess output has rounted to the servlet. (thank to Dave Carlson for the source
code!)
But I can not get the expected output which is "YES" or "NO" according to rules in
test.clp (as follows).
(defrule startup
=>
(assert (name (fetch A)))
(assert (value (fetch B)))
(printout t "<p>Here I printout indicates facts asserted!" crlf))
(defrule match-input
(name ?a)
(value ?b)
=>
(printout t "<p>This means input matched" crlf)
(printout t "<p>I print " ?a " and " ?b crlf)
(assert (stage yes-or-no)))
(defrule rule-yes-match
?a <- (eq ?a phase)
?b <-(eq ?b yes)
?choice <-(stage yes-or-no)
=>
(printout t "YES" crlf)
(retract ?choice ?a ?b))
(defrule rule-no-match
?a <-(eq ?a phase)
?b <-(eq ?b no)
?choice <-(stage yes-or-no)
=>
(printout t " NO" crlf)
(retract ?choice ?a ?b))
>From the browser, I get the result as following:
Here I printout indicates facts asserted!
This means input matched
I print phase and yes
I put reset and run in servlet as:
rete.executeCommand ("reset");
rete.executeCommand ("run");
It seems rule activiation was interrupted during the Rete execution, but no Rete
exception
threw.
How should i modify the test.clp file so I can get expected result.
Thank you in advance,
Beth Zhang
Dept. of Civil Engineering
National University of Singapore
Tel: 65-8746498(o)
Email: [EMAIL PROTECTED]
---------------------------------------------------------------------
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]
---------------------------------------------------------------------