knowledgeBuilder.getErrors()<div><br></div><div>   Edson<br><br><div class="gmail_quote">2010/8/16 Manav <span dir="ltr">&lt;<a href="mailto:manav7574@yahoo.com">manav7574@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Thanks Edson.  </div>
<div> </div>
<div>I don&#39;t why but when i am using the below rule in my drl it&#39;s failing to compile. </div>
<div>Not sure if i am doing something stupid or this is an issue with environment or the drl. </div>
<div> </div>
<div>I am attaching the drl file with the mail. The error that i get is : -</div>
<div> </div>
<div><font size="2">
<p align="left">testTestsRulesEngine(</p></font><u><font color="#000080" size="2"><font color="#000080" size="2">suitability.TestsRulesEngineTest)suitability.RulesEngineException</font></font></u><font size="2">: Could not load/compile rules file: testAccumulate.drl
<p align="left">at suitability.RulesEngine.&lt;init&gt;(</p></font><u><font color="#000080" size="2"><font color="#000080" size="2">RulesEngine.java:39</font></font></u><font size="2">)
<p align="left">at suitability.TestsRulesEngine.&lt;init&gt;(</p></font><u><font color="#000080" size="2"><font color="#000080" size="2">TestsRulesEngine.java:13</font></font></u><font size="2">)
<p align="left">at suitability.TestsRulesEngineTest.setUp(</p></font><u><font color="#000080" size="2"><font color="#000080" size="2">TestsRulesEngineTest.java:72</font></font></u><font size="2">)
<p align="left">Caused by: </p></font><u><font color="#000080" size="2"><font color="#000080" size="2">java.lang.NullPointerException</font></font></u><font size="2">
<p align="left">at org.drools.common.AbstractRuleBase.addPackages(</p></font><u><font color="#000080" size="2"><font color="#000080" size="2">AbstractRuleBase.java:434</font></font></u><font size="2">)
<p align="left">at org.drools.reteoo.ReteooRuleBase.addPackage(</p></font><u><font color="#000080" size="2"><font color="#000080" size="2">ReteooRuleBase.java:388</font></font></u><font size="2">)
<p align="left">at suitability.RulesEngine.&lt;init&gt;(</p></font><u><font color="#000080" size="2"><font color="#000080" size="2">RulesEngine.java:36</font></font></u><font size="2">)
<p align="left">... 14 more</p></font><br>Regards,</div>
<div>Manav</div><font color="#888888">
</font><div style="font-size:12pt;font-family:times new roman, new york, times, serif"><br><div class="hm">
</div><div style="font-size:12pt;font-family:times new roman, new york, times, serif"><div class="hm"><font face="Tahoma" size="2">
<hr size="1">
<b><span style="font-weight:bold">From:</span></b> Edson Tirelli &lt;<a href="mailto:tirelli@post.com" target="_blank">tirelli@post.com</a>&gt;<br><b><span style="font-weight:bold">To:</span></b> Manav &lt;<a href="mailto:manav7574@yahoo.com" target="_blank">manav7574@yahoo.com</a>&gt;; Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<br>
<b><span style="font-weight:bold">Sent:</span></b> Mon, August 16, 2010 7:46:54 PM<br><b><span style="font-weight:bold">Subject:</span></b> Re: [rules-users] Accumulate in Drools<br></font></div><div><div></div><div class="h5">
<br>
<div>     You can&#39;t use the cast and the method call in a regular constraint. You can use it as part of an expression. So:</div>
<div><br></div>
<div> $min_score : Number ()<br>   from accumulate (Client (productTypeExperience.keySet contains $name,<br>                     $score : productTypeExperience[$name],<br>                     min ( ((ExperienceLevel)$score).value() ) )</div>

<div><br></div>
<div>     We are working on the support of free form expressions on constraints for Drools 6 (not sure we can make it for 5.2).</div>
<div><br></div>
<div>     Edson</div><br><br>
<div class="gmail_quote">2010/8/15 Manav <span dir="ltr">&lt;<a href="mailto:manav7574@yahoo.com" rel="nofollow" target="_blank">manav7574@yahoo.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid">Hi,<br>I am trying my hand at the accumulate function in Drools 5.x but the drl fails<br>to compile.<br>Not sure what&#39;s wrong with it. Please help.<br>
This is the sample that i am working with<br><br>rule &quot;Test Accumulate Function&quot;<br>when<br> $p : ProductType ($name : name)<br> $min_score : Number ()<br>   from accumulate (Client (productTypeExperience.keySet contains $name,<br>
                     $score :<br>((ExperienceLevel)productTypeExperience[$name]).value()),<br>              min ($score))<br>then<br> System.out.println (&quot;$min_score&quot; + $min_score);<br>end<br>Regards,<br><font color="#888888">Manav<br>
</font>
<div>
<div></div>
<div><br><br><br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" rel="nofollow" target="_blank">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com/" rel="nofollow" target="_blank">www.jboss.com</a><br>
</div></div></div></div></div><br>







      </div>
</blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>