I use drools to verify an object. The object also has a getChildrenList () method, which returns the child objects associated with this object (master-detail relation).
I do some checks for the object, and then I want to check the child objects as well, so I also insert all the child objects into the working memory using the 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 start if the children are already inserted. I mean, because I'm changing some fact that the rule is firing again. How can I prevent this?
thanks
source share