I'm having a strange issue with drools :
I have the following rules :
rule "is my dog a baby?"
ruleflow-group "dog"
salience 10
when
dog : Dog(age <1 )
then
dog.setIsBaby(true);
end
rule "baby dog"
ruleflow-group "dog"
salience 9
when
myData : MyData( myDog.isBaby() == false)
then
System.out.println(myData.getMyDog().getIsBaby());
end
I insert in my session myData and myData.getMyDog()
, where myData.getMyDog.isBaby==false
The first rule is fired and my dog is set to be a baby. Then the second one is fired, and even it prints true .(even if the condition was to be false)
And when I test after firing all rules , myDog in myData is set to be a baby .
What am I doing wrong here ? Why does the second rule is fired ? is the problem in the session (stateful in my case) ?
I think that I need to say that I modify myData:myDog somewhere ,but I am not sure where .
Hope my question is clear, if not tell me.