Hi again, there seems to have been some kind of error for after my previous mail I made a rule that where supposed to match a definstance of a certain deftemplate and then use the undefinstance on the variable bound to the OBJECT slot but when I ran the engine and the rules fired the shadow facts where still on the fact list after the rules had fired. I had to restart totally to get the fact list right.
I have a suspecion that I previously in the same session had a rule that produced an error on the RHS side which involved the instances that I later wanted to remove. Perhaps that might be of some help. Can this be related to the problem that I reported with rules being put into the Rete network and then generating an error which made them impossible to undefrule? /best regards Mikael -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, November 30, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: Re: JESS: Retract on definstanced facts I think Mikael Rundqvist (ERA) wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] > Hi, > Jess version 60b3 > I have a question regarding the use of the retract and undefinstance: > > If I have created a fact through definstance is it supposed to work to use (retract ><definstanced fact-id>) > If I use this syntax I get TRUE back but the fact is still on the fact-list. > (retract) always returns TRUE, so that's not too reassuring -- it should probably return something more informative. Anyway, retracting a shadow fact is the same as calling undefinstance on the Java Bean. Jess> (defclass button java.awt.Button) java.awt.Button Jess> (definstance button (new java.awt.Button)) <Fact-0> Jess> (facts) f-0 (MAIN::button (accessibleContext <External-Address:java.awt.Button$AccessibleAWTButton>) (actionCommand "") (background nil) (enabled TRUE) (font nil) (foreground nil) (label "") (name "button0") (visible TRUE) (OBJECT <External-Address:java.awt.Button>)) For a total of 1 facts. Jess> (retract (fact-id 0)) TRUE Jess> (facts) For a total of 0 facts. If you've got a case where this doesn't work, then either there's something wrong with your example, or there's a bug in Jess. If you can compose the smallest possible program that will let me reproduce the problem, I'll be glad to have a look at it. --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 Org. 8920, MS 9012 [EMAIL PROTECTED] PO Box 969 http://herzberg.ca.sandia.gov Livermore, CA 94550 -------------------------------------------------------------------- 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] --------------------------------------------------------------------
