[rules-users] Question on eval block

Shah, Malay Malay.Shah at morganstanley.com
Mon Aug 3 16:18:00 EDT 2009


Hi,
 
I am trying to use eval block in one of the rules and am a bit confused
about it. The rule is something like this:
 
rule "LastCapacity"
when
    e: Execution(lastCapacity:lastCapacity,parentOid:parentOid)
    eo:
ExecutionOrder(entityOid:entityOid,msgType:msgType,execType:execType)
    eval(lastCapacity != null && entityOid == parentOid && msgType ==
"8")
then

..................
end

where Execution and ExecutionOrder are 2 objects that are linked by an
ID. I expect eval to return true for certain sets of objects that I
send. But, the above rule exits without running the consequence. On the
other hand, when I write the rule as:

 rule "LastCapacity"
when
    e: Execution(lastCapacity:lastCapacity==null,parentOid:parentOid)
    eo: ExecutionOrder(entityOid:entityOid == parentOid, msgType == "8")
then

.............................
end

the rule triggers the consequence for same set of objects. I thought
that if the expression in eval block comes out to be true, the
consequence will be triggered. Am I missing something obvious here?
 
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090803/9ba6e075/attachment.html 


More information about the rules-users mailing list