Hi all,
I know these questions are probably in the archive somewhere, but I can't
seem to find them, so I'm going to post them here:
Question 1. Here is a very simplified version of my code. What I want is
to be able to assert gofact, run the engine, and the output be like this (in
no particular order):
Got num: 56
Got num: 23
Got num: 34
Of course, what I get is this:
Got num: 56
So, my question is if there is any way to get the one alert fact to activate
tryrule 3 times and then be able to automatically retract the fact?
(deftemplate alert
(slot name)
(multislot globfacts)
)
(defrule tryrule
?a1 <- (alert (name ?name1) (globfacts $? ?gf1 $?))
(test (> ?gf1 10))
=>
(printout t "Got num: " ?gf1 crlf)
(retract ?a1)
)
(defrule tryrule2
(gofact)
=>
(assert (alert (name joe) (globfacts 23 34 56)))
)
Question 2. I have a multislot in a fact that matches on the LHS of a rule.
I want to be able to access the entire multislot AS WELL AS one single
expression within the multislot on the RHS of the rule. E.g.:
(defrule tryrule
(alert (name ?name1) (globfacts $?gfall))
=>
--------------------------------------------------------------------
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]
--------------------------------------------------------------------