You are adding 100 to a non-existing Map entry. Doing this in Java code like e.g.<br><br> HashMap<String,Integer> m = $u.getSubjectGradeMap();<br> m.put( "CompSc", m.get( "CompSc" ) + 100 );<br>
<br>would have thrown a NullPointerException, and you would have seen the problem.<br><br>MVEL, with its balmy-barmy way of hiding the realities of programming from you, sinks you in an infinite loop...<br><br>Verified with current master, and I won't create a JIRA for this one either, as moticated previously.<br>
<br>-W<br><br><br><div class="gmail_quote">2011/8/28 Neel <span dir="ltr"><<a href="mailto:neeleshdev@yahoo.co.in">neeleshdev@yahoo.co.in</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
Hi,<div>I'm using drools-5.3.0.Beta1. I've following rule definition:</div><div><p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<font color="#b70000"><br></font></p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 15px;"><span style="color: rgb(183, 0, 0);">import</span> java.util.*;</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 15px;"><br></p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span style="color: rgb(183, 0, 0);">declare</span> Student</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;"> name : String @key</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;"> subjectGradeMap : HashMap </p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">end</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 15px;"> </p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(0, 151, 0);"><span style="color: rgb(183, 0, 0);">rule</span><span style="color: rgb(0, 0, 0);"> </span>"Subject grade points"</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">dialect<span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 151, 0);">"mvel"</span></p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">when</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;"> $u : Student()</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">then</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;"> $u.subjectGradeMap[<span style="color: rgb(0, 151, 0);">"CompSc"</span>] += 100;</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;"> System.out.println(<span style="color: rgb(0, 151, 0);">"Marks added"</span>);</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">end</p>
<p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);"><span style="color: rgb(0, 0, 0); font-family: arial; font-size: 13px;"><br>
</span></p><p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: arial; font-size: 13px;">While executing RHS of above rule, fireAllRules() doesn't return, it hangs.</span></p><p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: arial; font-size: 13px;">Please help.</span></p><p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: arial; font-size: 13px;">Thanks,</span></p><p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: arial; font-size: 13px;">Neel</span></p><font color="#888888"><p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(183, 0, 0);">
<br></p></font></div></td></tr></tbody></table><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a 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>