title: Drools generate filters on rule dinamically
body: <p>New with JBoss Drools :)</p>
  <p>I'm working on a PoC where there's a rule where one or multiple filters can exist. I'm using a template to generate that rule dynamically.</p>
  <pre><code>template header
  
  effectiveDate
  expirationDate
  rule
  totalPriceValue
  
  package test.template;
  import  test.domain.ProductDiscountRequest;
  
  template &quot;value discount template&quot;
  
  rule &quot;Value discount on customer_@{row.rowNumber}&quot;
      date-effective &quot;@{effectiveDate}&quot;
      date-expires   &quot;@{expirationDate}&quot;
      when
          requestObject : ProductDiscountRequest(@{rule} &amp;&amp; totalPrice &gt; @{totalPriceValue});
      then
          requestObject.addDiscount(5.0d);
  end
  
  end template
  </code></pre>
  <p>This template, with the correct input, generates a rule like</p>
  <pre><code>package test.template;
  import  test.domain.ProductDiscountRequest;
  
  rule &quot;Value discount on customer_0&quot;
      date-effective &quot;25-Jun-2022 16:00&quot;
      date-expires   &quot;26-Jun-2030 8:00&quot;
      when
          requestObject : ProductDiscountRequest(customer == 'TestCustomer' &amp;&amp; totalPrice &gt; 30);
      then
          requestObject.addDiscount(5.0d);
  end
  </code></pre>
  <p>There are multiple filters available and they can also be combined, so <strong>customer == 'TestCustomer'</strong> can also be <strong>customer == 'TestCustomer' &amp;&amp; custGroup == &quot;TestGroup&quot;</strong> and so forth.
  I see 3 solutions:</p>
  <ol>
  <li>Generate the filtering part in the code and only insert it</li>
  <li>Create distinct rules per number of filters (1 rule for 1 filter, 1 rule for 2 filters etc)</li>
  <li>Send the filters to the template and generate it there directly</li>
  </ol>
  <p>I tried some things but I couldn't get #3 to work. Supposing that there's a list of filters, how do I iterate over it and concatenate it to a full condition?</p>
  <p>I'm open to other ideas to make this better.</p>