<!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=484345317-02122009><FONT color=#0000ff face=Verdana size=2>Mark,</FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=484345317-02122009><FONT color=#0000ff face=Verdana size=2></FONT></SPAN> </DIV>
<DIV align=left dir=ltr><SPAN class=484345317-02122009><FONT color=#0000ff face=Verdana size=2>In this case, the object types that are bound don't have
"not"/"or" conditions surrounding them (ExecutionOrderHist_core0 and
ExecutionHist_core0). So, these objects would always be there when the rule is
fired. Why would it still not identify and populate the variables of the
objects, and instead try to cast one object to another?</FONT></SPAN></DIV>
<DIV><FONT color=#0000ff face=Verdana size=2></FONT><FONT color=#0000ff face=Verdana size=2></FONT> </DIV>
<DIV><SPAN class=484345317-02122009><FONT color=#0000ff face=Verdana size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=484345317-02122009><FONT color=#0000ff face=Verdana size=2></FONT></SPAN> </DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 10pt">Malay Shah<BR></SPAN></DIV>
<DIV><SPAN class=484345317-02122009><FONT color=#0000ff face=Verdana size=2> </FONT></SPAN></DIV>
<DIV><SPAN class=484345317-02122009> </SPAN></DIV>
<DIV>
<HR tabIndex=-1>
</DIV>
<DIV><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> Wednesday, December 02, 2009 12:44 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>when using 'or' the bindings and the object types for those bindings
must balance for each logical outcome.<BR><BR>Mark<BR>Shah, Malay wrote:
<BLOCKQUOTE cite=mid:58A2A0069BCCBD4EA2F204631427BB9D01AFA4CF@NYWEXMBX2130.msad.ms.com type="cite">
<META content="MSHTML 6.00.6000.16915" name=GENERATOR>
<DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009><FONT color=#0000ff face=Verdana size=2>Thanks W. </FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009></SPAN> </DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009><FONT color=#0000ff face=Verdana size=2>I removed the binding of EtsExecutionOrderXref_core00,
and it looked good. But I am getting ClassCastException when adding new facts
and conditions. I now have a new fact (EtsExecutionHist_core0) and an eval
statement to check if the rule has already been fired for a unique key that is
determined by variables in EtsExecutionHist_core0 fact. </FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009></SPAN> </DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009><FONT color=#0000ff size=2>Exception in thread "main" org.drools.RuntimeDroolsException:
!(violations.containsKey("S-50_EtsExecutionHist_core" + "_entityOID_" +
EtsExecutionHist_core0_entityOID<BR>+ "_entityVID_" +
EtsExecutionHist_core0_entityVID<BR>)) : </FONT><STRONG><FONT color=#ff0000><FONT size=2>[Error:
com.ms.ieddata.etsdb.model.EtsExecutionOrderHist_core cannot be cast to
com.ms.ieddata.etsdb.model.EtsExecutionHist_core]</FONT><BR></FONT></STRONG></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009><FONT color=#0000ff face=Verdana size=2>When I don't have the eval statement, the rule works
perfectly well. Also, I checked that if I flip the order of defining facts in
the rule (i.e. having EtsExecutionHist_core0 fact before
EtsExecutionOrderHist_core0), the rule works fine. </FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009></SPAN> </DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009><FONT color=#0000ff face=Verdana size=2>Below is the drool code and the
error:</FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009></SPAN> </DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009><FONT color=#008000 face=Verdana size=2><STRONG>Drool Rule:</STRONG></FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009></SPAN> </DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009><FONT color=#0000ff size=2>package S_50 </FONT></SPAN></DIV>
<DIV> </DIV>
<DIV align=left dir=ltr><SPAN class=756320616-02122009><FONT color=#0000ff size=2>import com.ms.ieddata.dataQuality.violation.Violation;<BR>import
com.ms.ieddata.etsdb.model.EtsExecutionOrderHist_core;<BR>import
com.ms.ieddata.etsdb.model.EtsExecutionHist_core;<BR>import
com.ms.ieddata.etsdb.model.EtsExecutionOrderXref_core;</FONT></SPAN></DIV>
<DIV><SPAN class=756320616-02122009><FONT color=#0000ff size=2>global
java.util.HashMap violations;</FONT></SPAN></DIV>
<DIV><SPAN class=756320616-02122009><FONT color=#0000ff size=2>dialect
"mvel"<BR>rule "Legacy ETSDB
Rule"<BR>when<BR>
EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core<BR>
(<BR>
customerOrFirm != "0"<BR>
)<BR>
EtsExecutionHist_core0:EtsExecutionHist_core<BR>
(<BR>
parentOID ==
EtsExecutionOrderHist_core0.entityOID,<BR>
lastCapacity ==
"1",<BR>
application != "MMETL",<BR><STRONG><FONT color=#ff0000>
EtsExecutionHist_core0_entityOID:entityOID,<BR>
EtsExecutionHist_core0_entityVID:entityVID</FONT></STRONG><BR>
)<BR>
EtsExecutionOrderXref_core<BR>
(<BR>
entityOID ==
EtsExecutionOrderHist_core0.entityOID,<BR>
entityRID ==
EtsExecutionOrderHist_core0.entityRID,<BR>
entityVID ==
EtsExecutionOrderHist_core0.entityVID,<BR>
referenceID != "2" && referenceIDType ==
"orderSubCapacity"<BR>
)<BR>
or<BR>
not(EtsExecutionOrderXref_core<BR>
(<BR>
entityOID ==
EtsExecutionOrderHist_core0.entityOID,<BR>
entityRID ==
EtsExecutionOrderHist_core0.entityRID,<BR>
entityVID ==
EtsExecutionOrderHist_core0.entityVID,<BR>
referenceIDType ==
"orderSubCapacity"<BR>
)<BR>
)<BR><FONT color=#ff0000><STRONG>eval(!(violations.containsKey("S-50_EtsExecutionHist_core"
+ "_entityOID_" + EtsExecutionHist_core0_entityOID + "_entityVID_" +
EtsExecutionHist_core0_entityVID)))</STRONG></FONT><BR>then<BR>
System.out.println("Rule Fired");<BR>end</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=756320616-02122009><FONT color=#008000 face=Verdana size=2><STRONG>Exception:</STRONG></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff size=2>Exception in thread "main"
org.drools.RuntimeDroolsException:
!(violations.containsKey("S-50_EtsExecutionHist_core" + "_entityOID_" +
EtsExecutionHist_core0_entityOID<BR>+ "_entityVID_" +
EtsExecutionHist_core0_entityVID<BR>)) : <FONT color=#ff0000><STRONG>[Error:
com.ms.ieddata.etsdb.model.EtsExecutionOrderHist_core cannot be cast to
com.ms.ieddata.etsdb.model.EtsExecutionHist_core]<BR></STRONG></FONT>[Near :
{... Unknown
....}]<BR>
^<BR>[Line: 1, Column: 0]<BR> at
org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:122)<BR> at
org.drools.reteoo.EvalConditionNode.assertLeftTuple(EvalConditionNode.java:180)<BR> at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)<BR> at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:34)<BR> at
org.drools.reteoo.NotNode.assertLeftTuple(NotNode.java:123)<BR> at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:145)<BR> at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:39)<BR> at
org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:116)<BR> at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)<BR> at
org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:78)<BR> at
org.drools.reteoo.LIANodePropagation.doPropagation(LIANodePropagation.java:47)<BR> at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:649)<BR> at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:637)<BR> at
org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:203)<BR> at
com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:142)<BR> at
com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:73)<BR> at
com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.performDQ(DQCommandLineMain.java:291)<BR> at
com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.runEngine(DQCommandLineMain.java:196)<BR> at
com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.main(DQCommandLineMain.java:170)<BR>Caused
by: [Error: com.ms.ieddata.etsdb.model.EtsExecutionOrderHist_core cannot be
cast to com.ms.ieddata.etsdb.model.EtsExecutionHist_core]<BR>[Near : {...
Unknown
....}]<BR>
^<BR>[Line: 1, Column: 0]<BR> at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:388)<BR> at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:138)<BR> at
org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:133)<BR> at
org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:102)<BR> at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:37)<BR> at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:833)<BR> at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:315)<BR> at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:138)<BR> at
org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:133)<BR> at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:37)<BR> at
org.mvel2.ast.Substatement.getReducedValueAccelerated(Substatement.java:40)<BR> at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:37)<BR> at
org.mvel2.ast.Negation.getReducedValueAccelerated(Negation.java:44)<BR> at
org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)<BR> at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:104)<BR> at
org.mvel2.MVEL.executeExpression(MVEL.java:978)<BR> at
org.drools.base.mvel.MVELEvalExpression.evaluate(MVELEvalExpression.java:83)<BR> at
org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:117)<BR> ...
18 more<BR>Caused by: java.lang.ClassCastException:
com.ms.ieddata.etsdb.model.EtsExecutionOrderHist_core cannot be cast to
com.ms.ieddata.etsdb.model.EtsExecutionHist_core<BR> at
org.drools.base.com.ms.ieddata.etsdb.model.EtsExecutionHist_core32580467$getEntityVID.getValue(Unknown
Source)<BR> at
org.drools.base.ClassFieldReader.getValue(ClassFieldReader.java:91)<BR> at
org.drools.rule.Declaration.getValue(Declaration.java:244)<BR> at
org.drools.base.mvel.DroolsMVELPreviousDeclarationVariable.getValue(DroolsMVELPreviousDeclarationVariable.java:67)<BR> at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:446)<BR> at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:312)<BR> ...
35 more</FONT></DIV>
<DIV> </DIV>
<DIV><SPAN class=756320616-02122009><FONT color=#0000ff face=Verdana size=2>Am
I missing something here? I think this is a perfectly valid rule, where eval
statement is needed to make sure we don't fire the rule multiple times. I
don't have the entire consequence section in the drool code above, but we
perform multiple actions if rules are fired. I am trying to get to the bottom
of this, because we generate these Drool Rule Code on the fly, and I can't
determine the order in which facts (and their variables) would be
defined.</FONT></SPAN></DIV>
<DIV><SPAN class=756320616-02122009></SPAN> </DIV>
<DIV><SPAN class=756320616-02122009><FONT color=#0000ff face=Verdana size=2>Any kind of help here would be much appreciated.</FONT></SPAN></DIV>
<DIV><SPAN class=756320616-02122009></SPAN> </DIV>
<DIV><SPAN class=756320616-02122009><FONT color=#0000ff face=Verdana size=2>Thanks</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 10pt">Malay Shah<BR></SPAN><SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 7.5pt"><BR></SPAN></DIV>
<DIV> </DIV><BR>
<DIV align=left class=OutlookMessageHeader dir=ltr lang=en-us>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> <A class=moz-txt-link-abbreviated href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</A>
[<A class=moz-txt-link-freetext href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</A>]
<B>On Behalf Of </B>Wolfgang Laun<BR><B>Sent:</B> Wednesday, December 02, 2009
1:47 AM<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><SPAN><FONT size=+0><FONT color=#0000ff face=Verdana size=2>Binding a variable to a fact
in a branch of an 'or' (as you are doing with EtsExecutionOrderXref_core00) is
not useful, since you cannot use this binding in the consequence. (The rule
might just as well fire due to the 2nd term (the "or not...") being true, and
then the variable would not be bound, causing NPE.<BR><BR>If you do need this
binding to access the fact in the consequence, you should splt the
rule.<BR><BR>-W<BR></FONT></FONT></SPAN><BR>
<DIV class=gmail_quote>2009/12/2 Shah, Malay <SPAN dir=ltr><<A href="mailto:Malay.Shah@morganstanley.com" moz-do-not-send="true">Malay.Shah@morganstanley.com</A>></SPAN><BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV>
<DIV align=left dir=ltr><SPAN><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><FONT color=#0000ff face=Verdana size=2>Here
is the updated Drool rule:</FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN></SPAN> </DIV>
<DIV align=left dir=ltr><SPAN><FONT color=#0000ff face=Verdana size=2>
<DIV class=im>dialect "mvel"<BR>rule "Legacy ETSDB
Rule"<BR>when<BR>
EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm !=
"0")<BR>
EtsExecutionOrderXref_core00:EtsExecutionOrderXref_core<BR>
(<BR>
entityOID ==
EtsExecutionOrderHist_core0.entityOID,<BR>
entityRID ==
EtsExecutionOrderHist_core0.entityRID,<BR>
entityVID ==
EtsExecutionOrderHist_core0.entityVID,<BR>
referenceID != "2" && referenceIDType ==
"orderSubCapacity"<BR>
)<BR>
or<BR>
not(EtsExecutionOrderXref_core<BR>
(<BR>
entityOID ==
EtsExecutionOrderHist_core0.entityOID,<BR>
entityRID ==
EtsExecutionOrderHist_core0.entityRID,<BR>
entityVID ==
EtsExecutionOrderHist_core0.entityVID,<BR>
referenceIDType ==
"orderSubCapacity"<BR>
)<BR>
)<BR>then<BR></DIV> System.out.println("Rule
fired");<BR>end</FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN></SPAN> </DIV>
<DIV align=left dir=ltr><SPAN><FONT color=#0000ff face=Verdana size=2>and
here is the stack trace:</FONT></SPAN></DIV>
<DIV align=left dir=ltr><SPAN></SPAN> </DIV>
<DIV align=left dir=ltr><SPAN><FONT color=#ff0000 size=2>Exception in thread
"main" org.drools.runtime.rule.ConsequenceException:
java.lang.NullPointerException<BR> at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)<BR> at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)<BR> at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)<BR> at
org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)<BR> at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)<BR> at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:637)<BR> at
org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:203)<BR> at
com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:142)<BR> at
com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:73)<BR> at
com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.performDQ(DQCommandLineMain.java:291)<BR> at
com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.runEngine(DQCommandLineMain.java:196)<BR> at
com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.main(DQCommandLineMain.java:170)<BR>Caused
by: java.lang.NullPointerException<BR> at
org.drools.base.mvel.DroolsMVELFactory.getTupleObjectFor(DroolsMVELFactory.java:182)<BR> at
org.drools.base.mvel.DroolsMVELFactory.setContext(DroolsMVELFactory.java:176)<BR> at
org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:57)<BR> at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)<BR> ...
10 more</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN><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></SPAN></DIV>
<DIV><SPAN><FONT color=#0000ff face=Verdana size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN></SPAN> </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> </SPAN></DIV>
<DIV>
<HR>
<FONT face=Tahoma size=2><B>From:</B> <A href="mailto:rules-users-bounces@lists.jboss.org" moz-do-not-send="true" target=_blank>rules-users-bounces@lists.jboss.org</A> [mailto:<A href="mailto:rules-users-bounces@lists.jboss.org" moz-do-not-send="true" target=_blank>rules-users-bounces@lists.jboss.org</A>] <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 class=h5>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 type="cite">
<DIV>
<DIV><SPAN><FONT face=Verdana size=2>Hi All,</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN><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 there either exists an entity object EtsExecutionOrderXref_core00
with the given conditions, or the entity does not exist at all
with some other conditions. </FONT></SPAN></DIV>
<DIV><SPAN></SPAN> </DIV>
<DIV><SPAN></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> EtsExecutionOrderXref_core<BR> (<BR> entityOID
== EtsExecutionOrderHist_core0.entityOID , entityRID ==
EtsExecutionOrderHist_core0.entityRID , entityVID ==
EtsExecutionOrderHist_core0.entityVID , referenceID != "2" &&
referenceIDType == "orderSubCapacity"<BR> )<BR> or
not(EtsExecutionOrderXref_core<BR> (<BR> entityOID ==
EtsExecutionOrderHist_core0.entityOID , entityRID ==
EtsExecutionOrderHist_core0.entityRID , entityVID ==
EtsExecutionOrderHist_core0.entityVID , referenceIDType ==
"orderSubCapacity"<BR> ))<BR>)<BR></FONT>then<BR>end</FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff face=Verdana size=2>But, while compiling the
rule, I am getting the following errors:</FONT></DIV>
<DIV> </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>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> </DIV>
<DIV><SPAN><FONT face=Verdana size=2>Thanks</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV style="COLOR: black; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 10pt">Malay Shah</SPAN></DIV></DIV>
<DIV>
<HR>
</DIV>
<P 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. We<SPAN style="FONT-SIZE: 7.5pt; COLOR: gray"> may monitor and store emails to the
extent permitted by applicable law.</SPAN></FONT></SPAN></P><PRE><HR SIZE=4 width="90%">
_______________________________________________
rules-users mailing list
<A href="mailto:rules-users@lists.jboss.org" moz-do-not-send="true" target=_blank>rules-users@lists.jboss.org</A>
<A href="https://lists.jboss.org/mailman/listinfo/rules-users" moz-do-not-send="true" target=_blank>https://lists.jboss.org/mailman/listinfo/rules-users</A>
</PRE></BLOCKQUOTE><BR></DIV></DIV></DIV>
<DIV>
<DIV class=h5>
<DIV>
<HR>
</DIV>
<P 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. We<SPAN style="FONT-SIZE: 7.5pt; COLOR: gray"> may monitor and store emails to the
extent permitted by applicable
law.</SPAN></FONT></SPAN></P></DIV></DIV></DIV><BR>_______________________________________________<BR>rules-users
mailing list<BR><A href="mailto:rules-users@lists.jboss.org" moz-do-not-send="true">rules-users@lists.jboss.org</A><BR><A href="https://lists.jboss.org/mailman/listinfo/rules-users" moz-do-not-send="true" target=_blank>https://lists.jboss.org/mailman/listinfo/rules-users</A><BR><BR></BLOCKQUOTE></DIV><BR></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. 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. 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>