No, that is not the case. I tried this: jel.assertString("(qwe)"); jel.retractString("(qwe)"); jel.assertString("(qwe)");
and it still doesn't work. I only get the retract event. There must be something else going on in the bsaved file. Any clue? Henrique Ernest Friedman-Hill wrote: > One explanation consistent with your observations is that the bsaved > file already contains (qwe) and (asd) facts. If you attempt to assert > a fact that already exists in working memory, the assert method > returns FALSE and no event is sent. > > > On Jul 5, 2007, at 5:47 AM, Henrique Lopes Cardoso wrote: > >> I just extended Rete to make the example simpler. I also tried it with >> an independent JessListener implementing class, but the problem is >> the same. >> >> I tried to do Rete.addJessListener() after bload, just as you suggested, >> but the problem remains. >> >> So, I ask again: what could be wrong in my bsaved file that prevents >> some JessEvents from being notified? >> >> Henrique >> >> >> Jonathan Sewall wrote: >>> I didn't extend Rete just to create a JessListener, but I did find >>> that I needed to reregister my listeners after bload. >>> Henrique Lopes Cardoso wrote: >>>> I am stumbling for some time now with the use of a JessListener. After >>>> many tries, I figured out that the listener does not work properly >>>> when >>>> I bload() certain files. >>>> >>>> Since the Rete class implements JessListener, for ease of testing I >>>> extended it and got to the class below. >>>> From my experiences, if the bsave file is empty, it works fine. If >>>> I use >>>> another bsaved file that I have, I get problems. Only the retracted >>>> facts are being notified. >>>> >>>> Is this a bug? What should I look for in my bsaved file? >>>> >>>> Thanks. >>>> >>>> Henrique >>>> >>>> //--------------------------------------------- >>>> public class JEL extends Rete { >>>> public JEL() { >>>> super(); >>>> // set event mask >>>> setEventMask(JessEvent.FACT); >>>> // load file >>>> try { >>>> FileInputStream fis = new >>>> FileInputStream("somefile.bsave"); >>>> bload(fis); >>>> fis.close(); >>>> } catch (ClassNotFoundException cnfe) { >>>> cnfe.printStackTrace(); >>>> } catch (IOException ioe) { >>>> ioe.printStackTrace(); >>>> } >>>> } >>>> public void eventHappened(JessEvent jev) { >>>> System.out.println("EVENT:" + >>>> JessEvent.getEventName(jev.getType())); >>>> switch(jev.getType()) { >>>> case JessEvent.FACT | JessEvent.REMOVED: // retraction >>>> Fact whatWasRetracted = (Fact) jev.getObject(); >>>> < System.out.println("- - -" + whatWasRetracted); >>>> break; >>>> case JessEvent.FACT: // assertion >>>> Fact whatWasAsserted = (Fact) jev.getObject(); >>>> System.out.println("+ + +" + whatWasAsserted); >>>> break; >>>> } >>>> } >>>> public static void main(String args[]) { >>>> JEL jel = new JEL(); >>>> try { >>>> jel.assertString("(qwe)"); >>>> jel.retractString("(qwe)"); >>>> jel.assertString("(asd)"); >>>> } catch(JessException je) { >>>> je.printStackTrace(); >>>> } >>>> } >>>> } >>>> //---------------------------------------------- >>>> >>>> >>>> >>>> -------------------------------------------------------------------- >>>> 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] >>> -------------------------------------------------------------------- >>> >>> >> >> -- >> ----- - - - - - - - - - - - - >> Henrique Lopes Cardoso >> DEEC/FEUP >> Rua Dr. Roberto Frias | 4200-465 Porto >> PORTUGAL >> (+351)225081400 ext.1315 >> [EMAIL PROTECTED] | www.fe.up.pt/~hlc >> ----- - - - - - - - - - - - - >> >> -------------------------------------------------------------------- >> 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] >> -------------------------------------------------------------------- > > --------------------------------------------------------- > Ernest Friedman-Hill > Advanced Software Research Phone: (925) 294-2154 > Sandia National Labs FAX: (925) 294-2234 > PO Box 969, MS 9012 [EMAIL PROTECTED] > Livermore, CA 94550 http://www.jessrules.com > > -------------------------------------------------------------------- > 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] > -------------------------------------------------------------------- > > -- ----- - - - - - - - - - - - - Henrique Lopes Cardoso DEEC/FEUP Rua Dr. Roberto Frias | 4200-465 Porto PORTUGAL (+351)225081400 ext.1315 [EMAIL PROTECTED] | www.fe.up.pt/~hlc ----- - - - - - - - - - - - - -------------------------------------------------------------------- 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] --------------------------------------------------------------------