Hi All,
I am using drools to validate an object. The object also has a getChildrenList() method which returns the child objects related to this object (master-detail relation).
I do some validations on the object and then I want to validate the child objects as well, so I insert all of the child objects as well into the working memory by using following rule:
rule "Insert Children"
when
$parent : Parent ( eval(childrenList != empty) )
$ch : Child() from $p.childrenList
then
insert($ch);
end
Now how can I make sure that this rule does not get fired if the children were already inserted. I mean because I modify some fact the rule gets re-fired. How can I prevent that?
Thanks