[rules-users] Drool Rule Error with "or not" condition

Mark Proctor mproctor at codehaus.org
Tue Dec 1 18:55:54 EST 2009


You are binding the result of the 'or' to EtsExecutionOrderXref_core00 
as the second part is a 'not' which returns nothing, how would it be 
bound to?

Shah, Malay wrote:
> Hi All,
>  
> 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. 
>  
> dialect "mvel"
> rule "Legacy ETSDB Rule"
> when
> EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm 
> != "0")
> EtsExecutionOrderXref_core00:
> (
>  EtsExecutionOrderXref_core
>  (
>   entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == 
> EtsExecutionOrderHist_core0.entityRID , entityVID == 
> EtsExecutionOrderHist_core0.entityVID , referenceID != "2" && 
> referenceIDType == "orderSubCapacity"
>  )
>  or not(EtsExecutionOrderXref_core
>  (
>   entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == 
> EtsExecutionOrderHist_core0.entityRID , entityVID == 
> EtsExecutionOrderHist_core0.entityVID , referenceIDType == 
> "orderSubCapacity"
>  ))
> )
> then
> end
>  
> But, while compiling the rule, I am getting the following errors:
>  
> org.drools.compiler.DroolsParserException: [ERR 101] Line 22:16 no 
> viable alternative at input 'entityOID' in rule "Legacy ETSDB Rule" in 
> pattern not,
>
> org.drools.compiler.DroolsParserException: [ERR 102] Line 22:68 
> mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in 
> pattern EtsExecutionOrderHist_core0.entityOID,
>
> org.drools.compiler.DroolsParserException: [ERR 102] Line 22:122 
> mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in 
> pattern EtsExecutionOrderHist_core0.entityOID in pattern 
> EtsExecutionOrderHist_core0.entityRID,
>
> org.drools.compiler.DroolsParserException: [ERR 102] Line 22:176 
> mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in 
> pattern EtsExecutionOrderHist_core0.entityOID in pattern 
> EtsExecutionOrderHist_core0.entityRID in pattern 
> EtsExecutionOrderHist_core0.entityVID]
>
> 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?
>  
> Thanks
>  
> Malay Shah
> ------------------------------------------------------------------------
>
> 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 may monitor and 
> store emails to the extent permitted by applicable law.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091201/586094f7/attachment.html 


More information about the rules-users mailing list