<!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"> I would like to execute specific
rules from the rule file(.xml). Find the</FONT> <FONT
face="Courier New">rule file content below. There are three rules are available
in the xml 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"> First time we are trying to execute
1.Check_NotNullof_rfqId 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> </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> </DIV>
<DIV><FONT face="Courier New" size=2><SPAN
class=684314508-28092007>The 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" )); </SPAN></FONT></DIV>
<DIV><FONT face="Courier New" size=2><SPAN
class=684314508-28092007></SPAN></FONT> </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> </DIV>
<DIV><FONT face="Courier New" size=2><SPAN class=684314508-28092007>When
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> </DIV>
<DIV><FONT face="Courier New" size=2><SPAN
class=684314508-28092007></SPAN></FONT> </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> </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> </DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT
face="Courier New"><?xml version="1.0" encoding="UTF-8"?><BR><package
name="rules"<BR> xmlns="<A
href="http://drools.org/drools-4.0">http://drools.org/drools-4.0</A>"<BR>
xmlns:xs="<A
href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>"<BR>
xs:schemaLocation="<A
href="http://drools.org/drools-4.0">http://drools.org/drools-4.0</A>
drools-4.0.xsd"></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT
face="Courier New"> <import
name="com.wipro.rfq.report.bean.Validator.RFQBean"
/><BR><STRONG> <global identifier="rfq"
type="com.wipro.rfq.report.bean.Validator.RFQBean"
/><BR></STRONG> <BR> <STRONG><rule
name="Check_NotNullof_rfqId">
<!--start
of rule
1--><BR></STRONG> <lhs><BR> <eval>(rfq.getM_rfqId()
=="null") ||
(rfq.getM_rfqId().trim().equals(""))</eval><BR> </lhs><BR> <rhs><BR> System.out.println("The
value of m_rfqId is
null");<BR> </rhs><BR> </rule> </FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT
face="Courier New"><STRONG> <rule name="Check_NotNullof_partId">
<BR></STRONG> <lhs><BR> <eval>(rfq.getM_partId()
=="null") ||
(rfq.getM_partId().trim().equals(""))</eval><BR> </lhs><BR> <rhs><BR> System.out.println("The
value of m_partId is
null");<BR> </rhs><BR> </rule></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT
face="Courier New"> <import
name="com.wipro.loan.validation.bean.LoanApplicationBean"
/><BR> <STRONG><global identifier="loanApplication"
type="com.wipro.loan.validation.bean.LoanApplicationBean"
/></STRONG></FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2><SPAN class=684314508-28092007><FONT
face="Courier New"><BR><STRONG> <rule
name="validateFullName"></STRONG><BR>
<lhs><BR> <BR>
<eval>loanApplication.getFullName() == null ||
loanApplication.getFullName().trim().equals("")</eval><BR>
</lhs><BR> <rhs><BR> System.out.println("full name
is null from xml");<BR> </rhs><BR>
</rule><BR></package></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>