<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    <br>
    Hi Wolfgang,<br>
    <br>
    Sure. Please find attached a small Maven/Eclipse project containing
    3 DRT and 3 unit test cases (Java in src/test/java/org/drools/bug,
    rules in src/test/resource/org/drools/bug) :<br>
    <ul>
      <li>Test1OK(.java/.drt/.csv) is the one working well<br>
      </li>
      <li>Test1KO(.java/.drt/.csv) is the one illustrating the 1)
        behavior</li>
      <li>Test1KO2(.java/.drt/.csv) is the one illustrating the 2)
        behavior</li>
    </ul>
    Regards,<br>
    <br>
    Bruno.<br>
    <br>
    Le 03/11/2011 14:07, Wolfgang Laun a &eacute;crit&nbsp;:
    <blockquote
cite="mid:CANaj1LdfEU-8JmB+_O5LohDegBuhx9PJw=bJ3Q3_13Lu3wQBtg@mail.gmail.com"
      type="cite">Before you work on a JIRA could you please provide an
      (abbreviated) example of a template that causes both errors?<br>
      -W<br>
      <br>
      <div class="gmail_quote">2011/11/3 Bruno Freudensprung <span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:bruno.freudensprung@temis.com">bruno.freudensprung@temis.com</a>&gt;</span><br>
        <blockquote class="gmail_quote" style="border-left: 1px solid
          rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
          1ex;">
          <div text="#000000" bgcolor="#ffffff"> Hi all,<br>
            <br>
            I am writing rules using Drools Templates and I noticed
            strange problems (ocurring when I slightly modify a DRT that
            works well): <br>
            <ol>
              <li>the template instanciation depends on the declarations
                order of the parameters in the template header</li>
              <li>if the rule template does not contain a package
                declaration (default package) the instanciation of the
                template fails</li>
            </ol>
            I am working with Drools 5.1.1 but those problems occur in
            5.2.0.Final and in 5.3.0.Final as well.<br>
            Do you think it is worth posting a JIRA?<br>
            <br>
            Anyway let me tell you that Drools Templates are great! Our
            users like that feature a lot! They start writing a rule in
            DRL format and, once it works, they transform it into a DRT
            and put data into a tsv file. It is quite a natural way of
            working. The general perception here is that it is easier to
            "templatize" an existing DRL than to write a decision table
            from scratch.<br>
            <br>
            Best regards,<br>
            <br>
            Bruno.<br>
            <br>
            PS:<br>
            <br>
            <u>DRT that works well</u>:<br>
            <br>
            <tt>template header<br>
              <b>name<br>
                message<br>
                <br>
                package templates;<br>
              </b><br>
              import org.drools.bug.Entity;<br>
              <br>
              template "TestTemplate"<br>
              rule "Test1 @{row.rowNumber}"<br>
              &nbsp;&nbsp;&nbsp; dialect "mvel"<br>
              &nbsp;&nbsp;&nbsp; when<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Entity( $name : name == "@{name}" )<br>
              &nbsp;&nbsp;&nbsp; then<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("@{message}" + $name);<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; insert($name);<br>
              end<br>
              end template<br>
            </tt><br>
            <u>DRT that does not work</u> (first case):<br>
            <br>
            <tt>template header<br>
              <b>message<br>
                name<br>
                <br>
                package templates;<br>
              </b><br>
              import org.drools.bug.Entity;<br>
              <br>
              template "TestTemplate"<br>
              rule "Test1 @{row.rowNumber}"<br>
              &nbsp;&nbsp;&nbsp; dialect "mvel"<br>
              &nbsp;&nbsp;&nbsp; when<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Entity( $name : name == "@{name}" )<br>
              &nbsp;&nbsp;&nbsp; then<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("@{message}" + $name);<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; insert($name);<br>
              end<br>
              end template</tt><br>
            <br>
            <br>
            <u>DRT that does not work</u> (second case):<br>
            <br>
            <tt>template header<br>
              <b>name<br>
                message<br>
              </b><br>
              import org.drools.bug.Entity;<br>
              <br>
              template "TestTemplate"<br>
              rule "Test1 @{row.rowNumber}"<br>
              &nbsp;&nbsp;&nbsp; dialect "mvel"<br>
              &nbsp;&nbsp;&nbsp; when<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Entity( $name : name == "@{name}" )<br>
              &nbsp;&nbsp;&nbsp; then<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("@{message}" + $name);<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; insert($name);<br>
              end<br>
              end template</tt><br>
            <br>
            <br>
          </div>
          <br>
          _______________________________________________<br>
          rules-users mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
          <a moz-do-not-send="true"
            href="https://lists.jboss.org/mailman/listinfo/rules-users"
            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>