does anybody know if there is a way to do for loops in drools ?.
I am trying to loop through a list of string to see if one of the strings matches a pattern e.g.
def listOfStrings = ['a','a.b','a.b.c']
for(String s:listOfStrings){
if(s matches "^a.b.*$"){
return true
}
}
I have written the following rule based on what documentation I could find, but I dont think the syntax is correct
rule "Matcher"
when
TestClass : TestClass(($s matches "^a.b.*$") from listOfStrings, count($s))
then
TestClass.setResponse( "Condition is True !!" );
end
I am finding it hard to find good documentation on the drl language
I would appreciate any help that anybody can give me