If you need an 'OR', may be you just need two rules, with or without a
salience :
(defrule OR_Alert_gross
(gross (value ?x))
=>
(printout t "Complex_Alert 100 -> gross" crlf)
)
(defrule OR_Alert_cost
(cost (value ?y))
=>
(printout t "Complex_Alert 100 -> cost" crlf)
)
If one of the two conditions is set, a rule will be fired (it's an OR ;).
Emmanuel Lecharny, IKTEK
06 08 33 32 61, www.iktek.com <http://www.iktek.com>
-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De
la part de Mike Leiper
Envoye : vendredi 23 mars 2001 16:11
A : [EMAIL PROTECTED]
Objet : JESS: New JESS USER- Help with OR condition
Hello Jess Users,
I'm new to JESS and playing with templates and rules. I'm trying to
create a
rule that performs and 'or' on two facts:
; Fact Templates
(deftemplate gross "gross product"
(slot value (type INTEGER))
)
(deftemplate cost "cost product"
(slot value (type INTEGER))
)
;Complex Alerts Alerts of Alerts
(defrule Example_OR_Alert
(or (gross (value ?x))
(cost (value ?y)))
=>
; (send-alert 46 2 2)
(printout t "Complex_Alert 100 " crlf)
)
JESS does not accept my rule definition. I receive the following error
message:
Jess reported an error in routine Jesp.parsePattern while executing
(batch "templates1.txt").
Message: Bad slot value .
Program text: ( defrule Example_OR_Alert ( or ( at line 12.
jess.Value jess.Jesp.parseSexp()
jess.Value jess.Jesp.parse(boolean)
void jess.Main.execute(boolean)
void jess.ConsoleApplet.run()
void java.lang.Thread.run()
If someone could please help me with my rule definition using the 'or'
function, I would greatly appreciate it.
Thank you,
mike
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
---------------------------------------------------------------------
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]
---------------------------------------------------------------------