title: are for loops possible in drools?
body: <p>does anybody know if there is a way to do for loops in drools ?.</p>
  
  <p>I am trying to loop through a list of string to see if one of the strings matches a pattern e.g.</p>
  
  <pre><code>def listOfStrings = ['a','a.b','a.b.c']
  
  for(String s:listOfStrings){
   if(s matches "^a.b.*$"){
   return true 
   }
  }
  </code></pre>
  
  <p>I have written the following rule based on what documentation I could find, but I dont think the syntax is correct</p>
  
  <pre><code>rule "Matcher"
     when
        TestClass : TestClass(($s matches "^a.b.*$") from listOfStrings, count($s))
     then
        TestClass.setResponse( "Condition is True !!" );
  end
  </code></pre>
  
  <p>I am finding it hard to find good documentation on the drl language</p>
  
  <p>I would appreciate any help that anybody can give me</p>
  
  <hr>
  
  <p>Based on the previous answer, I have tried the following</p>
  
  <pre><code>rule "Matcher"
    when
   TestClass:TestClass(String( this matches "^a.b.*$" ) from listOfStrings)
  then
         TestClass.setResponse( "Condition is True !!" );
  end 
  </code></pre>
  
  <p>However, I now get the following error message:</p>
  
  <pre><code>[43,197]: unknown:43:197 Unexpected token 'this'
  </code></pre>