-------------- Original message --------------
From: "Edson Tirelli" <email@example.com>
Your reasoning is correct. There should not be 2 instances of ApplicantStatus in the working memory.
Can you provide a test case showing the problem? we have test cases here using "not" and logical assertions, and it works properly.
How is "not" supposed to work with insertLogical? Assume I have two different rules whose conditions are mutually exclusive, like the following:
rule"Rule One" when not NegativeResult() then insertLogical(new ApplicantStatus("Approved"));
rule"Rule Two" when NegativeResult() then insertLogical(new ApplicantStatus("Denied"));
Assume that the above two rules are the only way anApplicantStatus fact can be inserted into working memory. I would expect, after all rules are run, that it would be impossible for there to be one ApplicantStatus with "Approved" as its reason, and another with "Denied" as its reason, in the working memory.
I would expect that, before anyNegativeResult is inserted, that rule one could run, and insert an ApplicantStatus fact with an "Approved" reason. Then, after a NegativeResult is inserted, that rule two could run, and insert an ApplicantStatus fact with a "Denied" reason. At this point I would expect that the original ApplicantStatus fact, with an "Approved" reason, would be retracted, since the conditions under which it was inserted are no lon! ger true.
This is not what I am observing, however. I am findingApplicantStatus facts with both reasons in working memory at the end of the rules run. Should "not" work as I expect with regard to inserting a fact via insertLogical()? Or is this a known limitation, or simply the way it is designed to work?
rules-users mailing list
JBoss Drools Core Development
JBoss, a division of Red Hat @ www.jboss.com