<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Thank you for the e-mail. The function does not seem to be included in the DRL. I shall run it again, and post again if I cannot get to a resolution.<br><br>Krishna<br><br><hr id="stopSpelling">Date: Sun, 21 Dec 2008 13:59:56 +0000<br>From: mproctor@codehaus.org<br>To: rules-users@lists.jboss.org<br>Subject: Re: [rules-users] How to use function in decision table<br><br>




  
  <title></title>


Bhamidi Krishna wrote:
<blockquote cite="mid:BAY144-W481D0161D9C37E4991F7F3C6F30@phx.gbl">
  <style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>Hi, I am attempting to use a function in a decision table, I
am sure I have gotten it totally wrong because it gives me the
following error -<br>
&nbsp;<br>
  <u><font color="#000080" size="2">org.drools.compiler.DroolsParserException</font></u><font color="#ff0000" size="2">: Unknown error while parsing. This is a bug.
Please contact the Development team.<br>
  </font>
  <p align="left"><font color="#ff0000" size="2">at
org.drools.compiler.DrlParser.compile(</font><u><font color="#000080" size="2">DrlParser.java:183</font></u><font color="#ff0000" size="2">)</font></p>
  <p align="left"><font color="#ff0000" size="2">at
org.drools.compiler.DrlParser.parse(</font><u><font color="#000080" size="2">DrlParser.java:61</font></u><font color="#ff0000" size="2">)</font></p>
  <p align="left"><font color="#ff0000" size="2">at
org.drools.compiler.PackageBuilder.addPackageFromDrl(</font><u><font color="#000080" size="2">PackageBuilder.java:165</font></u><font color="#ff0000" size="2">)</font></p>
  <p align="left"><font color="#ff0000" size="2">at
com.sample.DecisionTableTest.readDecisionTable(</font><u><font color="#000080" size="2">DecisionTableTest.java:60</font></u><font color="#ff0000" size="2">)</font></p>
  <font color="#ff0000" size="2">at com.sample.DecisionTableTest.main(</font><u><font color="#000080" size="2">DecisionTableTest.java:35</font></u><font color="#ff0000" size="2">)</font><br>
&nbsp;<br>
  <font color="#ff0000" size="2"><font color="#000000">I have attached
my decision table, the relevant portion of the table is pasted. Would
appreciate ponters in the right direction.</font></font><br>
</blockquote>
If often helps to look at the DRL that is being outputted, that should
help you see what is wrong in the DTable.<br>
<blockquote cite="mid:BAY144-W481D0161D9C37E4991F7F3C6F30@phx.gbl">&nbsp;<br>
  <font color="#000000">Thank you</font><br>
&nbsp;<br>
&nbsp;<br>
  <font color="#ff0000" size="2"><font color="#000000">
  <table style="width: 586pt; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="780">
    <colgroup>
    <col style="width: 53pt;" width="70"><col style="width: 105pt;" width="140">
    <col style="width: 93pt;" width="124"><col style="width: 69pt;" width="92">
    <col style="width: 37pt;" width="49"><col style="width: 49pt;" width="65">
    <col style="width: 54pt;" width="72"><col style="width: 41pt;" width="55">
    <col style="width: 37pt;" width="49"><col style="width: 48pt;" width="64">
    </colgroup><tbody>
      <tr style="height: 12.75pt;" height="17">
        <td class="EC_xl28" style="border: 0.5pt solid windowtext; width: 53pt; height: 12.75pt; background-color: rgb(255, 255, 153);" width="70" height="17"><strong><font face="Calibri">&nbsp;</font></strong></td>
        <td class="EC_xl25" style="border-style: solid solid solid none; border-color: windowtext; border-width: 0.5pt 0.5pt 0.5pt medium; width: 105pt; background-color: transparent;" width="140"><font face="Calibri">450_60_20_30</font></td>
        <td class="EC_xl25" style="border-style: solid solid solid none; border-color: windowtext; border-width: 0.5pt 0.5pt 0.5pt medium; width: 93pt; background-color: transparent;" width="124"><font face="Calibri">PROFIT</font></td>
        <td class="EC_xl25" style="border-style: solid solid solid none; border-color: windowtext; border-width: 0.5pt 0.5pt 0.5pt medium; width: 69pt; background-color: transparent;" width="92"><font face="Calibri">PRICE</font></td>
        <td class="EC_xl27" style="border-style: solid solid solid none; border-color: windowtext; border-width: 0.5pt 0.5pt 0.5pt medium; width: 37pt; background-color: transparent;" align="right" width="49"><font face="Calibri">2</font></td>
        <td class="EC_xl26" style="border-style: solid solid solid none; border-color: windowtext; border-width: 0.5pt 0.5pt 0.5pt medium; width: 49pt; background-color: transparent;" width="65"><font face="Calibri"><span style="">&nbsp;</span>PRICE<span style="">&nbsp;</span></font></td>
        <td class="EC_xl25" style="border-style: solid solid solid none; border-color: windowtext; border-width: 0.5pt 0.5pt 0.5pt medium; width: 54pt; background-color: transparent;" width="72"><font face="Calibri">&lt;</font></td>
        <td class="EC_xl25" style="border-style: solid solid solid none; border-color: windowtext; border-width: 0.5pt 0.5pt 0.5pt medium; width: 41pt; background-color: transparent;" width="55"><font face="Calibri">Relative</font></td>
        <td class="EC_xl25" style="border-style: solid solid solid none; border-color: windowtext; border-width: 0.5pt 0.5pt 0.5pt medium; width: 37pt; background-color: transparent;" align="right" width="49"><font face="Calibri">25</font></td>
        <td class="EC_xl25" style="border-style: solid solid solid none; border-color: windowtext; border-width: 0.5pt 0.5pt 0.5pt medium; width: 48pt; background-color: transparent;" width="64"><font face="Calibri">equal</font></td>
      </tr>
      <tr style="height: 12.75pt;" height="17">
        <td class="EC_xl28" style="border-style: none solid solid; border-color: windowtext; border-width: medium 0.5pt 0.5pt; height: 12.75pt; background-color: rgb(255, 255, 153);" height="17"><strong><font face="Calibri">&nbsp;</font></strong></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">450_60_20_30</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">PROFIT</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">STOCK</font></td>
        <td class="EC_xl27" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;" align="right"><font face="Calibri">2</font></td>
        <td class="EC_xl26" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri"><span style="">&nbsp;</span>STOCK<span style="">&nbsp;</span></font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">B</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">Absolute</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;" align="right"><font face="Calibri">5</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">equal</font></td>
      </tr>
      <tr style="height: 12.75pt;" height="17">
        <td class="EC_xl28" style="border-style: none solid solid; border-color: windowtext; border-width: medium 0.5pt 0.5pt; height: 12.75pt; background-color: rgb(255, 255, 153);" height="17"><strong><font face="Calibri">&nbsp;</font></strong></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">450_60_20_30</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">PROFIT</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">CONTRACT</font></td>
        <td class="EC_xl27" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;" align="right"><font face="Calibri">2</font></td>
        <td class="EC_xl26" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri"><span style="">&nbsp;</span>CONTRACT<span style="">&nbsp;</span></font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">B</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">Absolute</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;" align="right"><font face="Calibri">10</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">equal</font></td>
      </tr>
      <tr style="height: 12.75pt;" height="17">
        <td class="EC_xl28" style="border-style: none solid solid; border-color: windowtext; border-width: medium 0.5pt 0.5pt; height: 12.75pt; background-color: rgb(255, 255, 153);" height="17"><strong><font face="Calibri">&nbsp;</font></strong></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">450_60_20_30</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">SERVICE</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">FM</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;" align="right"><font face="Calibri">2</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">FM</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">&gt;</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">Absolute</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;" align="right"><font face="Calibri">30</font></td>
        <td class="EC_xl25" style="border-style: none solid solid none; border-color: windowtext; border-width: medium 0.5pt 0.5pt medium; background-color: transparent;"><font face="Calibri">equal</font></td>
      </tr>
      <tr style="height: 12.75pt;" height="17">
        <td class="EC_xl24" style="height: 12.75pt; background-color: transparent;" height="17"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><br>
        </td>
      </tr>
      <tr style="height: 12.75pt;" height="17">
        <td class="EC_xl24" style="height: 12.75pt; background-color: transparent;" height="17"><br>
        </td>
        <td class="EC_xl24" style="background-color: transparent;"><font face="Calibri">Functions</font></td>
        <td class="EC_xl24" style="background-color: transparent;" colspan="8">
        <font face="Calibri">function absoluteCompareFunction(int
weight,String sign,String value, String compareValue ) double
returnValue=0.0; if(value==null || compareValue==null) { return
returnValue; } if(value.equalsIgnoreCase(compareValue)) { returnValue=
weight; } end</font><br>
&nbsp;<br>
&nbsp;<br>
        <BR>
        </td>
      </tr>
    </tbody>
  </table>
  </font></font><br>
  <hr>Suspicious message? There’s an alert for that. <a href="http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008">Get your Hotmail® account now.</a>
  <pre><hr size="4" width="90%"><br>_______________________________________________<br>rules-users mailing list<br><a class="EC_moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a class="EC_moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>  </pre>
</blockquote>
<br><br /><hr />Send e-mail faster without improving your typing skills. <a href='http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008' target='_new'>Get your Hotmail® account.</a></body>
</html>