Use (defquery)
 
See the manual:
 
http://herzberg.ca.sandia.gov/jess/docs/61/language.html#queries
 
or the JIA book section 17.7
 
alan
 
-----Original Message-----
From: Jim VanDragt [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 10:09 AM
To: [EMAIL PROTECTED]
Subject: JESS: Finding Facts by name within a Jess User Defined Function


I want to write a function that needs to find a fact by name. For example I need to find the fact "MAIN::work-surface" and evaluate it's slot values.  Is there a way to search through all the facts to find a certain one?

      f-0   (MAIN::initial-fact)
      f-1   (MAIN::vocabulary (product work-surface))
      f-2   (MAIN::work-surface (shape rectangular) (product-line 2) (depth 24) (width 62) (order-string "Z2R,BUL,G4,62,24E,1X,CO,ED") (shape-code R) (top-material L) (top-finish 1X) (top-finish-entered not-defined) (front-edge E) (front-edge-finish ED) (side-edge not-defined) (side-edge-finish CO) (secondary-finish BU) (b ack-edge-cord-drop G4) (support-type not-defined))
      For a total of 3 facts.

TIA

Jim Van Dragt
Herman Miller Inc.
(616) 654-5285

Reply via email to