Hello,

   What is the difference between calling insert and update in a rule file? When I use insert my queries don’t work, but if I use update they seem to. I don't mind using update, but I would like to understand the difference between the two. Here is my rule file.

    rule "Add person to math class"
    no-loop
        when
            person : Person(likesMath == true)
        then
            person.setClassName("Math");
            insert(person);
    end

   I also have a query:

   query getPeopleForClass(String _className)
      Person(className == _className)
   end

   When I add two facts to working memory, where the likesMath attribute is true, then run my query I get zero results back. When I change the rule, "Add person to math class", to use update(person) instead of insert(person) two students are returned.

  Any help would be appreciated.

Thanks,
Dan


Daniel Quinn
Fedex - Custom Critical
Software Specialist I
234.310.4090(x2586)

-----Original Message-----
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of thomaskukofka@web.de

Sent: Wednesday, September 10, 2008 2:27 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Re: looping problem

Hello,

thanks that works. I just forgot to set the focus in the init rule..

Regards
Thomas
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users