You were completely right, I expanded the error message routine and found out that my event routine had some errors And the insertion of the fact did succeed.
Thanks Teun ________________________________ Van: [email protected] [mailto:[email protected]] Namens Wolfgang Laun Verzonden: donderdag 19 februari 2009 20:08 Aan: [email protected] Onderwerp: Re: JESS: Problem with adding a fact to the rete engine in Java The code you've posted and the error message just don't match. I think that everything up to and including m_rete.assertFact(afct); succeeds, and the error occurs later. -W On Thu, Feb 19, 2009 at 4:31 PM, Theunissen, Teun <[email protected]<mailto:[email protected]>> wrote: I am creating a fact in a java method. When I add this fact to the rete engine I get the following error: An error occurred at line: -1 which look like: null Errormessage: No slot __data in deftemplate MAIN::answer The problem is that the answer fact is an unordered fact and the deftemplate is defined in the MAIN module. It seems that the rete engine handles this fact as an ordered fact. What can I do to solve this problem? The java code that builds the fact: public void assertAnswer(String identifier, String answer, int valuetype) { try { Fact afct = new Fact("answer", m_rete); afct.setSlotValue("ident", new Value(identifier,RU.SYMBOL)); afct.setSlotValue("text", new Value(answer,valuetype)); System.out.println(afct.toString()); m_rete.assertFact(afct); The messages on the console: Focus: MAIN (MAIN::answer (ident IL1_1) (text NEE)) JessEvent: [JessEvent: a fact was asserted] An error occurred at line: -1 which look like: null Errormessage: No slot __data in deftemplate MAIN::answer Kind regards Teun Theunissen
