Hi Matthias,
Before aserting facts give (reset) command.
See Manual 2.8.6; not patterns requires (initial-fact)
(deftemplate node (slot ip) (slot status)) ; status can be up or down
(defrule all-nodes-are-down
(not (exists (node (status up))))
=> (printout t "All nodes are down !" crlf))
....
(reset)
(assert (node (ip "1.1.1.1") (status down)))
(assert (node (ip "2.2.2.2") (status down)))
(run)
.....
Bye
Manish
-----Original Message-----
From: Matthias Blankenhaus [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 3:58 AM
To: [EMAIL PROTECTED]
Subject: JESS: rule activation
Hello !
I like to fire a rule when none of my facts match a certain attribute.
(deftemplate node (slot ip) (slot status)) ; status can be up or down
(defrule all-nodes-are-down
(not (exists (node (status up))))
=> (printout t "All nodes are down !" crlf))
....
(assert (node (ip "1.1.1.1") (status down)))
(assert (node (ip "2.2.2.2") (status down)))
(run)
.....
For some reason this does not work.
What am I doing wrong here ?
Thanx for your help !
Matthias
--------------------------------------------------------------------
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]
--------------------------------------------------------------------
MASTEK
Investing in relationships
In the US, we're called MAJESCO
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek
Limited, unless specifically indicated to that effect. Mastek Limited does not accept
any responsibility or liability for it. This e-mail and attachments (if any)
transmitted with it are confidential and/or privileged and solely for the use of the
intended person or entity to which it is addressed. Any review, re-transmission,
dissemination or other use of or taking of any action in reliance upon this
information by persons or entities other than the intended recipient is prohibited.
This e-mail and its attachments have been scanned for the presence of computer
viruses. It is the responsibility of the recipient to run the virus check on e-mails
and attachments before opening them. If you have received this e-mail in error, kindly
delete this e-mail from all computers.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------------------------------
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]
--------------------------------------------------------------------