Hi,
I faced a similar problem. This thread helped me to solve the issue. this
keyword is working fine for me. U can check whether it is supported in your
version. I am using 5.0.1
But even this keyword works for me, I am facing another problem.
The then block executed for every success in the
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
Thanks for the response
Since I dont actually need to keep a count of the number of strings that
match the pattern in the list, I have changed your solution to the code
below to make it simpler.
rule Matcher
when
TestClass( $list : listOfStrings )
String( this matches ^a.b.*$ )