Hi,
Need help here. I do not know how to get the facts out
when it is embeded in Java. I ran the code in Java:-
r.executeCommand("(deftemplate adv-attributes" +
"(slot id)" +
"(multislot attribs))");
r.executeCommand("(defrule show-adv-attributes" +
//"?fact <- (adv-attributes (id ?id)
(attribs ?attribs))" +
"(adv-attributes (id ?id) (attribs
?attribs))" +
"=>" +
"(printout t \"-------------------------\"
crlf)" +
//"(printout t \"Fact-id=\" ?fact crlf)" +
// declare a list variable, so that it
will append one by one?
"(printout t \"id=\" ?id crlf)" +
"(printout t \"attribs=\" ?attribs
crlf))");
r.reset();
r.executeCommand("(assert (adv-attributes (id 1)
(attribs low-budget)))");
r.executeCommand("(assert (adv-attributes (id 2)
(attribs control-message-frequency)))");
r.run();
Java throws me this exception:-
Jess reported an error in routine Jesp.parseDefrule.
Message: Expected '=>' .
Program text: ( defrule show-adv-attributes?fact <-
at line 1.
I commented a few lines, I can see that the rule is
fired twice. How can I grep the rules which is fired
and how do I know which factID is fired is I cannot
use ?fact <- (adv-attributes (id $id) (attribs
$attribs))?
-------------------------
id=2attribs=control-message-frequency
-------------------------
id=1attribs=low-budget
f-0 (MAIN::initial-fact)
f-1 (MAIN::adv-attributes (id 1) (attribs
low-budget))
f-2 (MAIN::adv-attributes (id 2) (attribs
control-message-frequency))
For a total of 3 facts.
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
--------------------------------------------------------------------
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]
--------------------------------------------------------------------