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!