Assuming you are using 4.0, just bind one and compare to the other:

rule XXX
when
    Tree( $new : newNumberLeaves, oldNumberLeaves > $new )
then
   // do something
end
 
   []s
   Edson

2007/6/7, Wagner Rick - rwagne <Rick.Wagner@acxiom.com>:
Hi all,

I'd like to make a comparison of two attributes on the same object, but
would like to do it in one line to facilitate easy DSL.

Example:

Class Tree{
        int oldNumberLeaves;
        int newNumberLeaves;
}

What I'd like to say is "when the oldNumberLeaves > newNumberLeaves
then...."

Can anyone give me a tip on this one?

Thanks much,

Rick
*************************************************************************
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be
legally privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank you.
*************************************************************************

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com