<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3157" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=684314508-28092007><FONT 
face="Courier New">&nbsp;&nbsp;&nbsp; I would like to execute&nbsp;specific 
rules&nbsp;from the&nbsp;rule file(.xml). Find the</FONT> <FONT 
face="Courier New">rule file content below. There are three rules are available 
in the xml&nbsp;file(Rule names: 1.Check_NotNullof_rfqId , 
2.Check_NotNullof_partId and 3.validateFullName)</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=684314508-28092007><FONT 
face="Courier New">&nbsp;&nbsp;&nbsp; First time we are trying to execute 
1.Check_NotNullof_rfqId&nbsp;and 2.Check_NotNullof_partId rules. next time we 
are trying to execute 3.validateFullName rule</FONT></SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=684314508-28092007><FONT 
face="Courier New">We have tried the following option 
</FONT></SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007><STRONG></STRONG></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007>The&nbsp;rule name start with <STRONG>"Check" 
</STRONG>require to set only <STRONG>"rfq" </STRONG>global 
identifier.</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=684314508-28092007>So when we 
execute first two rules we followed following approach</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=684314508-28092007><SPAN 
class=684314508-28092007><SPAN 
class=684314508-28092007>workingMemory.setGlobal("rfq",rfqbean);</SPAN></SPAN></SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007>workingMemory.fireAllRules(new 
RuleNameStartsWithAgendaFilter( "Check" ));&nbsp; </SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=684314508-28092007>but it gives 
following NullPointerException. It is trying to execute validatefullname rule 
also.</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=684314508-28092007>Caused by: 
java.lang.NullPointerException<BR>at 
rules.Rule_Check_NotNullof_rfqId_0.eval0(Rule_Check_NotNullof_rfqId_0.java:9)<BR>at 
rules.Rule_Check_NotNullof_rfqId_0Eval0Invoker.evaluate(Rule_Check_NotNullof_rfqId_0Eval0Invoker.java:16)<BR>at 
org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:71)<BR>... 12 
more</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=684314508-28092007>When&nbsp; 
we execute third rule alone. we followed following approach</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=684314508-28092007><SPAN 
class=684314508-28092007>workingMemory.setGlobal("loanApplication",loanApplicationbean);</SPAN></SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007>workingMemory.fireAllRules(new 
RuleNameStartsWithAgendaFilter( "validate" ));</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN 
class=684314508-28092007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=684314508-28092007>Please help 
us to resolve this issue</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=684314508-28092007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=684314508-28092007><STRONG>XML 
rule File</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=684314508-28092007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT 
face="Courier New">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<BR>&lt;package 
name="rules"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns="<A 
href="http://drools.org/drools-4.0">http://drools.org/drools-4.0</A>"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
xmlns:xs="<A 
href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
xs:schemaLocation="<A 
href="http://drools.org/drools-4.0">http://drools.org/drools-4.0</A> 
drools-4.0.xsd"&gt;</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT 
face="Courier New">&nbsp;&lt;import 
name="com.wipro.rfq.report.bean.Validator.RFQBean" 
/&gt;<BR><STRONG>&nbsp;&lt;global identifier="rfq" 
type="com.wipro.rfq.report.bean.Validator.RFQBean" 
/&gt;<BR></STRONG>&nbsp;&nbsp;<BR>&nbsp;<STRONG>&lt;rule 
name="Check_NotNullof_rfqId"&gt; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--start 
of rule 
1--&gt;<BR></STRONG>&nbsp;&nbsp;&lt;lhs&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;eval&gt;(rfq.getM_rfqId() 
=="null") || 
(rfq.getM_rfqId().trim().equals(""))&lt;/eval&gt;<BR>&nbsp;&nbsp;&lt;/lhs&gt;<BR>&nbsp;&nbsp;&lt;rhs&gt;<BR>&nbsp;&nbsp;&nbsp;System.out.println("The 
value of m_rfqId is 
null");<BR>&nbsp;&nbsp;&lt;/rhs&gt;<BR>&nbsp;&lt;/rule&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT 
face="Courier New"><STRONG>&nbsp;&lt;rule name="Check_NotNullof_partId"&gt; 
<BR></STRONG>&nbsp;&nbsp;&lt;lhs&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;eval&gt;(rfq.getM_partId() 
=="null") || 
(rfq.getM_partId().trim().equals(""))&lt;/eval&gt;<BR>&nbsp;&nbsp;&lt;/lhs&gt;<BR>&nbsp;&nbsp;&lt;rhs&gt;<BR>&nbsp;&nbsp;&nbsp;System.out.println("The 
value of m_partId is 
null");<BR>&nbsp;&nbsp;&lt;/rhs&gt;<BR>&nbsp;&lt;/rule&gt;</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT 
face="Courier New">&nbsp;&lt;import 
name="com.wipro.loan.validation.bean.LoanApplicationBean" 
/&gt;<BR>&nbsp;<STRONG>&lt;global identifier="loanApplication" 
type="com.wipro.loan.validation.bean.LoanApplicationBean" 
/&gt;</STRONG></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT 
face="Courier New"><BR><STRONG>&nbsp; &lt;rule 
name="validateFullName"&gt;</STRONG><BR>&nbsp; 
&lt;lhs&gt;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; 
&lt;eval&gt;loanApplication.getFullName() == null || 
loanApplication.getFullName().trim().equals("")&lt;/eval&gt;<BR>&nbsp; 
&lt;/lhs&gt;<BR>&nbsp;&lt;rhs&gt;<BR>&nbsp;&nbsp;System.out.println("full name 
is null from xml");<BR>&nbsp;&nbsp;&lt;/rhs&gt;<BR>&nbsp; 
&lt;/rule&gt;<BR>&lt;/package&gt;</FONT></SPAN></FONT></DIV></BODY></HTML>

<table><tr><td bgcolor=#ffffff><font color=#000000><br>
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. <br>
<br>
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.<br>
 <br>
www.wipro.com<br>
</font></td></tr></table>