Sounds like a bug to me. The order of the statements should not cause any change in the behavior.
  Can you please open a JIRA for it attaching your test case?

  Thanks
    Edson

2008/5/8 Gras, Patrick <Patrick.Gras@generali.ch>:

Hello,

I have a question because insertLogical does not behave as I expected.

Here is the example I use; I have a class 'cat' that is dynamic (JavaBean with PropertyChangeSupport ) with only a 'name' attribute.

Then I have following rule:

rule "test"
        when
                $cat:Cat( name == "tom" )
        then
                $cat.setName("cat");
                insertLogical(new String("test"));
               
end

When I test the rule against a cat named tom, the logical inserted fact is not retracted. (So the fact is inserted because the rule matches, but is not retracted even if the rule is no more matching at the end.)

If I change the order of the RHS, it works fine. The fact is inserted and then retracted.

rule "test"
        when
                $cat:Cat( name == "tom" )
        then
                insertLogical(new String("test"));
                $cat.setName("cat");
end

Is that the normal behavior ?

-Patrick

Patrick Gras
GENERALI Assurances
Service Informatique
Avenue Perdtemps 23
1260 Nyon 1
Tél. direct: +41 58 471 05 87
<mailto:patrick.gras@generali.ch>
P Please consider the environment before printing this E-Mail!



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




--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com