<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi guys,<br>
    <br>
    As you have probably noticed, today is my "decision tables day" :-).<br>
    Before telling you what is going wrong, let me show you what kind of
    rule I try to put in my Drools 5.1 decision table:<br>
    <br>
    <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # for each window<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $window : Window($elements : elements) from $windows<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # for each manual annotation<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $an1 : ManualAnnotation( this inside $window &amp;&amp;
      text == <b>"ToMatch"</b>)</tt><br>
    <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # if there is another manual annotation<br>
    </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exists ManualAnnotation( this inside $window
      &amp;&amp; text == <b>"ToMatch2"</b>)</tt><br>
    &nbsp;&nbsp; <br>
    The only things I would like to parametrize are strings in bold.<br>
    My decision table looks like this:<br>
    <br>
    <table border="1" cellpadding="2" cellspacing="2" width="100%">
      <tbody>
        <tr>
          <td valign="top">CONDITION</td>
          <td valign="top">CONDITION</td>
          <td valign="top">CONDITION<br>
          </td>
          <td valign="top">CONDITION</td>
          <td valign="top">CONDITION<br>
          </td>
        </tr>
        <tr>
          <td valign="top"><br>
          </td>
          <td valign="top"><tt>$an1 : ManualAnnotation</tt></td>
          <td valign="top"><br>
          </td>
          <td valign="top"><tt>exists ManualAnnotation</tt></td>
          <td valign="top"><br>
          </td>
        </tr>
        <tr>
          <td valign="top"><tt>$window : Window($elements...</tt></td>
          <td valign="top"><tt>this inside $window</tt><br>
          </td>
          <td valign="top"><tt>text </tt>== "$1"<br>
          </td>
          <td valign="top"><tt>this inside $window</tt></td>
          <td valign="top"><tt>text </tt>== "$1"</td>
        </tr>
        <tr>
          <td valign="top">for each window<br>
          </td>
          <td valign="top">annotation inside window<br>
          </td>
          <td valign="top"><tt>Text </tt></td>
          <td valign="top">annotation inside window</td>
          <td valign="top"><tt>Text </tt></td>
        </tr>
        <tr>
          <td valign="top">N/A</td>
          <td valign="top">N/A</td>
          <td valign="top">ToMatch<br>
          </td>
          <td valign="top">N/A</td>
          <td valign="top">ToMatch2</td>
        </tr>
        <tr>
          <td valign="top">N/A</td>
          <td valign="top">N/A</td>
          <td valign="top">ToMatch3</td>
          <td valign="top">N/A</td>
          <td valign="top">ToMatch4</td>
        </tr>
      </tbody>
    </table>
    <br>
    Here are the problems (in bold) with the generated rule:<br>
    <br>
    <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $an1 : ManualAnnotation( <b>this inside $window ==
        "N/A"</b> &amp;&amp; text == <b>"</b>ToMatch<b>"</b>)</tt><br>
    <tt></tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exists ManualAnnotation( <b>this inside
        $window == "N/A"</b> &amp;&amp; text == <b>"</b>ToMatch2<b>"</b>)</tt><br>
    <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <b>$window : Window($elements : elements) from $windows</b><br>
    </tt><br>
    <ul>
      <li>The order of the LHS "fact lines" of the generated rules is
        the not same as the order of appearance in the spreadsheet</li>
      <li>The "this inside $window" is considered as a field name</li>
    </ul>
    Do you know if I can solve those problems? <br>
    I have tried to find a way to tell the decision table to extend
    another rule but I haven't found a keyword for that in the
    documentation.<br>
    <br>
    Maybe do I have to use rule templates?<br>
    <br>
    Many thanks,<br>
    Best regards,<br>
    <br>
    Bruno.<br>
    <br>
  </body>
</html>