<span style="font-size: 7.5pt; color: gray;"><font color="gray" face="Arial" size="1"><span style="font-size: 14pt;"><font size="2"><font color="#000000" face="Times New Roman" size="3"><font face="Arial" size="1"><font size="2"><p class="MsoNormal">
when</p><p class="MsoNormal">                System ($users: users)</p><p class="MsoNormal">                $user : User () from $users</p><p class="MsoNormal">                eval ( <span style="font-size: 7.5pt; color: gray;"><font><font><font><font><font color="gray" face="Arial" size="1"><span style="font-size: 14pt;"><font size="2"><font color="#000000" face="Times New Roman" size="3"><font face="Arial" size="1"><font size="2">“SuperUser”.equals( </font></font></font></font></span></font></font></font></font></font></span><span style="font-size: 7.5pt; color: gray;"><font color="gray" face="Arial" size="1"><span style="font-size: 14pt;"><font size="2"><font color="#000000" face="Times New Roman" size="3"><font face="Arial" size="1"><font size="2"><b>HelperFunction.getUserType($user)</b></font></font></font></font></span></font></span> ) )</p>
<p class="MsoNormal"><br></p><p class="MsoNormal">You just cannot bind the result of a method/function call to a variable. Inside eval, you are in Java country, so don&#39;t use ==.</p><p class="MsoNormal"><br></p><p class="MsoNormal">
-W<br></p></font></font></font></font></span></font></span><br><br><div class="gmail_quote">2011/1/17 Mohod, Akash <span dir="ltr">&lt;<a href="mailto:Akash.Mohod@morganstanley.com">Akash.Mohod@morganstanley.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>
<div><span style="font-size: 7.5pt; color: gray;"><font color="gray" face="Arial" size="1"><span style="font-size: 14pt;"><font size="2"><font color="#000000" face="Times New Roman" size="3"><font face="Arial" size="1"><font size="2"><div>
<p class="MsoNormal">Hi, </p><p class="MsoNormal"> </p><p class="MsoNormal">I want to do something like this in my rule : -</p><p class="MsoNormal"> </p><p class="MsoNormal">when</p><p class="MsoNormal">                System ($users: users)</p>
<p class="MsoNormal">                $user : User () from $users</p><p class="MsoNormal">                <b>$userType : HelperFunction.getUserType($user)</b></p><p class="MsoNormal">                eval($userType == “SuperUser”)</p>
<p class="MsoNormal">then</p><p class="MsoNormal">                System.out.println(“ User Type is ” + $userType);</p><p class="MsoNormal">end</p><p class="MsoNormal"> </p><p class="MsoNormal">The idea is I want to get the type of user using a static function call in the LHS. Is it possible to do so in the LHS. </p>
<p class="MsoNormal">I am using Drools 5.1 . </p><p class="MsoNormal"> </p><p class="MsoNormal">Regards,</p><p class="MsoNormal">Akash </p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal"> </p></div>
</font></font></font></font></span></font></span></div>
<div><span style="font-size: 7.5pt; color: gray;"><font color="gray" face="Arial" size="1"><span style="font-size: 14pt;"><font size="2"><font color="#000000" face="Times New Roman" size="3"><font face="Arial" size="1">
<hr>
</font></font></font></span></font></span></div>
<div><span style="font-size: 7.5pt; color: gray;"><font face="Arial"><span style="font-size: 14pt;"><font face="Times New Roman"><font face="Arial"><font color="#808080" size="1">NOTICE: <span style="font-size: 7.5pt; color: gray;"><font face="Arial"><span style="font-size: 14pt;"><font face="Times New Roman"><font face="Arial"><font size="1"><font color="#808080"><span style="font-size: 9pt;" lang="EN-GB"><font size="1">Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. </font></span></font></font></font></font></span></font></span>If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: </font><a href="http://www.morganstanley.com/disclaimers" target="_blank"><font color="#808080" size="1">http://www.morganstanley.com/disclaimers</font></a><font color="#808080" size="1">. If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.</font></font></font></span></font></span></div>
<font size="+0"></font><font size="+0"></font><font size="+0"></font><span></span><font size="+0"></font><span></span></div>
<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>