<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><head><META content="text/html; charset=us-ascii" http-equiv="Content-Type">

<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META content="MSHTML 6.00.6000.16915" name=GENERATOR></head><BODY>
<DIV>
<DIV align=left dir=ltr><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2>Thanks Mark. I removed the binding and the rule is compiled 
now, but while firing the rule over set of objects, I get a Null pointer 
exception. </FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2>Here is the updated Drool rule:</FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2></FONT></SPAN>&nbsp;</DIV>
<DIV align=left dir=ltr><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2>dialect "mvel"<BR>rule "Legacy ETSDB 
Rule"<BR>when<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm != 
"0")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
EtsExecutionOrderXref_core00:EtsExecutionOrderXref_core<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
entityOID == 
EtsExecutionOrderHist_core0.entityOID,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
entityRID == 
EtsExecutionOrderHist_core0.entityRID,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
entityVID == 
EtsExecutionOrderHist_core0.entityVID,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
referenceID != "2" &amp;&amp; referenceIDType == 
"orderSubCapacity"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
or<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
not(EtsExecutionOrderXref_core<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
entityOID == 
EtsExecutionOrderHist_core0.entityOID,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
entityRID == 
EtsExecutionOrderHist_core0.entityRID,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
entityVID == 
EtsExecutionOrderHist_core0.entityVID,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
referenceIDType == 
"orderSubCapacity"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
)<BR>then<BR>&nbsp;&nbsp;&nbsp; System.out.println("Rule 
fired");<BR>end</FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2></FONT></SPAN>&nbsp;</DIV>
<DIV align=left dir=ltr><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2>and here is the stack trace:</FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2></FONT></SPAN>&nbsp;</DIV>
<DIV align=left dir=ltr><SPAN class=134551900-02122009><FONT color=#ff0000 size=2>Exception in thread "main" org.drools.runtime.rule.ConsequenceException: 
java.lang.NullPointerException<BR>&nbsp;at 
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)<BR>&nbsp;at 
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)<BR>&nbsp;at 
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)<BR>&nbsp;at 
org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)<BR>&nbsp;at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)<BR>&nbsp;at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:637)<BR>&nbsp;at 
org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:203)<BR>&nbsp;at 
com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:142)<BR>&nbsp;at 
com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:73)<BR>&nbsp;at 
com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.performDQ(DQCommandLineMain.java:291)<BR>&nbsp;at 
com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.runEngine(DQCommandLineMain.java:196)<BR>&nbsp;at 
com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.main(DQCommandLineMain.java:170)<BR>Caused 
by: java.lang.NullPointerException<BR>&nbsp;at 
org.drools.base.mvel.DroolsMVELFactory.getTupleObjectFor(DroolsMVELFactory.java:182)<BR>&nbsp;at 
org.drools.base.mvel.DroolsMVELFactory.setContext(DroolsMVELFactory.java:176)<BR>&nbsp;at 
org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:57)<BR>&nbsp;at 
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)<BR>&nbsp;... 
10 more</FONT></SPAN></DIV>
<DIV><FONT color=#0000ff face=Verdana size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2>After debugging through, DroolMVELFactory class object is looking for 
Declaration definition for "EtsExecutionOrderXref_core00", not finding it, and 
hence giving a null pointer exception. I am using Drools 5.0.1. Any idea about 
why this would happen? Does the rule seem right now?</FONT></SPAN><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2></FONT></SPAN></DIV>
<DIV><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=134551900-02122009><FONT color=#0000ff face=Verdana size=2></FONT></SPAN>&nbsp;</DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 10pt">Malay Shah</SPAN></DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 10pt"><BR>&nbsp;</DIV></SPAN>
<DIV>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org 
[mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>Mark 
Proctor<BR><B>Sent:</B> Tuesday, December 01, 2009 6:56 PM<BR><B>To:</B> Rules 
Users List<BR><B>Subject:</B> Re: [rules-users] Drool Rule Error with "or not" 
condition<BR></FONT><BR></DIV>
<DIV></DIV>You are binding the result of the 'or' to <FONT face=Verdana><FONT size=2><FONT color=#0000ff>EtsExecutionOrderXref_core00 </FONT></FONT></FONT>as 
the second part is a 'not' which returns nothing, how would it be bound 
to?<BR><BR>Shah, Malay wrote: 
<BLOCKQUOTE cite=mid:58A2A0069BCCBD4EA2F204631427BB9D01AFA494@NYWEXMBX2130.msad.ms.com type="cite">
  <META content="MSHTML 6.00.6000.16915" name=GENERATOR>
  <DIV>
  <DIV><SPAN class=231283223-01122009><FONT face=Verdana size=2>Hi 
  All,</FONT></SPAN></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><SPAN class=231283223-01122009><FONT face=Verdana size=2>I have the 
  following drool rule that has "or not" under Entity Block. Basically, the rule 
  tries to check if&nbsp;there either exists an entity object 
  EtsExecutionOrderXref_core00 with&nbsp;the&nbsp;given conditions, or the 
  entity does not exist at all with some other 
  conditions.&nbsp;</FONT></SPAN></DIV>
  <DIV><SPAN class=231283223-01122009><FONT size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=231283223-01122009></SPAN><FONT face=Verdana><FONT size=2><FONT color=#0000ff>dialect "mvel"<BR>rule "Legacy ETSDB 
  Rule"<BR>when<BR>EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm 
  != 
  "0")<BR>EtsExecutionOrderXref_core00:<BR>(<BR>&nbsp;EtsExecutionOrderXref_core<BR>&nbsp;(<BR>&nbsp;&nbsp;entityOID 
  == EtsExecutionOrderHist_core0.entityOID , entityRID == 
  EtsExecutionOrderHist_core0.entityRID , entityVID == 
  EtsExecutionOrderHist_core0.entityVID , referenceID != "2" &amp;&amp; 
  referenceIDType == "orderSubCapacity"<BR>&nbsp;)<BR>&nbsp;or 
  not(EtsExecutionOrderXref_core<BR>&nbsp;(<BR>&nbsp;&nbsp;entityOID == 
  EtsExecutionOrderHist_core0.entityOID , entityRID == 
  EtsExecutionOrderHist_core0.entityRID , entityVID == 
  EtsExecutionOrderHist_core0.entityVID , referenceIDType == 
  "orderSubCapacity"<BR>&nbsp;))<BR>)<BR></FONT>then<BR>end</FONT></FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT color=#0000ff face=Verdana size=2>But, while compiling the rule, I 
  am getting the following errors:</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Verdana size=2><FONT size=2>org.drools.compiler.DroolsParserException: [ERR 101] Line 22:16 no 
  viable alternative at input </FONT><FONT color=#2a00ff size=2><FONT color=#2a00ff size=2>'entityOID'</FONT></FONT><FONT size=2> in rule "Legacy 
  ETSDB Rule" in pattern not, </FONT></FONT></DIV>
  <DIV>
  <P><FONT face=Verdana size=2><FONT size=2>org.drools.compiler.DroolsParserException: [ERR 102] Line 22:68 
  mismatched input </FONT><FONT color=#2a00ff size=2><FONT color=#2a00ff size=2>','</FONT></FONT><FONT size=2> expecting </FONT><FONT color=#2a00ff size=2><FONT color=#2a00ff size=2>'('</FONT></FONT><FONT size=2> in rule 
  "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID, 
  </FONT></FONT></P>
  <P><FONT face=Verdana size=2><FONT size=2>org.drools.compiler.DroolsParserException: [ERR 102] Line 22:122 
  mismatched input </FONT><FONT color=#2a00ff size=2><FONT color=#2a00ff size=2>','</FONT></FONT><FONT size=2> expecting </FONT><FONT color=#2a00ff size=2><FONT color=#2a00ff size=2>'('</FONT></FONT><FONT size=2> in rule 
  "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in 
  pattern EtsExecutionOrderHist_core0.entityRID, </FONT></FONT></P>
  <P><FONT face=Verdana size=2><FONT size=2>org.drools.compiler.DroolsParserException: [ERR 102] Line 22:176 
  mismatched input </FONT><FONT color=#2a00ff size=2><FONT color=#2a00ff size=2>','</FONT></FONT><FONT size=2> expecting </FONT><FONT color=#2a00ff size=2><FONT color=#2a00ff size=2>'('</FONT></FONT><FONT size=2> in rule 
  "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in 
  pattern EtsExecutionOrderHist_core0.entityRID in pattern 
  EtsExecutionOrderHist_core0.entityVID]</FONT></FONT></P></DIV>
  <DIV><FONT face=Verdana size=2><SPAN class=231283223-01122009>I think the rule 
  is correct, but am not able to figure out these compilation errors. Could 
  anybody please comment on why this would happen? </SPAN></FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><SPAN class=231283223-01122009><FONT face=Verdana size=2>Thanks</FONT></SPAN></DIV>
  <DIV>&nbsp;</DIV>
  <DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 10pt">Malay Shah</SPAN></DIV></DIV>
  <DIV>
  <HR>
  </DIV>
  <P class=BulletedList style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0in"><SPAN style="FONT-SIZE: 8pt; COLOR: gray"><FONT color=gray face=Arial size=1>NOTICE: 
  If received in error, please destroy, and notify sender. Sender does not 
  intend to waive confidentiality or privilege. Use of this email is prohibited 
  when received in error.&nbsp;We<SPAN style="FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: 'Arial','sans-serif'"> may 
  monitor and store emails to the extent permitted by applicable 
  law.</SPAN></FONT></SPAN></P><PRE wrap><HR SIZE=4 width="90%">
_______________________________________________
rules-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A>
<A class=moz-txt-link-freetext href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</A>
  </PRE></BLOCKQUOTE><BR></DIV>
<DIV>
<HR>
</DIV>
<P CLASS="BulletedList" STYLE="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0in; mso-list: none; tab-stops: .5in"><SPAN STYLE="FONT-SIZE: 8pt; COLOR: gray; mso-bidi-font-family: Arial"><FONT COLOR="gray" FACE="Arial" SIZE="1">NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.&nbsp;We<SPAN STYLE="FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"> may monitor and store emails to the extent permitted by applicable law.</SPAN></FONT></SPAN></P>
<DIV></DIV></BODY></HTML>