In the below rule the logic in then-part is getting executed for all Child-objects which pass the given condition, I want to break the loop after the logic in then-part is executed only once, how to do this
rule "test"
when
Parent( $childList : childList != null, childList.empty == false)
Child('testing'.equalsIgnoreCase(attribute)) from $childList
then
// testLogic
end
If you don't need a reference to the
Childobject (or any of its attributes) in theRHS, then you can use anexistsoperator:If for some reason you do need the
Childobject or any of its attributes you can do something like this (although is not very nice):Hope it helps,