[rules-users] Error with Comparisons in rules

Giovanni Motta mottagio at gmail.com
Thu Jun 10 11:57:54 EDT 2010


And also, more concisely :

$a: A(x.name == y.name)
 if you want to
'check if x and y have same name in A'

Il giorno 10 giugno 2010 17.55.12 UTC+2, Giovanni Motta
<mottagio at gmail.com>ha scritto:

> Did you see my response on the other thread?
> You can do:
>
> $x : X()
>
> $y :Y(name == x.name)
>
> $a : A( x == $x, y == $y}
>
>
> Regards
>
>
> 2010/6/10 Fnu Mahalakshmi <FMahalakshmi at nyx.com>
>
>>  Hi guys,
>>
>>
>>
>> Can we compare 2 attributes of an object in a rule??
>>
>> Example:
>>
>>
>>
>> A{
>>
>> Object x,
>>
>> Object y,
>>
>> String status,
>>
>> }
>>
>> X{
>>
>> String name
>>
>> }
>>
>> Y{
>>
>> String name
>>
>> }
>>
>>
>>
>> Rule “ check if x and y have same name in A”
>>
>> When
>>
>> $x : X()
>>
>> $y :Y()
>>
>> $a : A( x == $x, y == $y}                        //this part not working
>> for me
>>
>> Eval($x.name == $y.name)
>>
>> Then
>>
>> Modify($a){
>>
>> setStatus(“same”)
>>
>> };
>>
>>
>>
>> End
>>
>>
>>
>> Is there a better way to achieve this????
>>
>>
>>
>> Please help.
>>
>>
>>
>> Thank you
>>
>> M
>>
>> ------------------------------
>>
>> *Please consider the environment before printing this email.*
>>
>> *Visit our website at http://www.nyse.com
>> *****************************************************************************
>>
>> Note: The information contained in this message and any attachment to it
>> is privileged, confidential and protected from disclosure. If the reader of
>> this message is not the intended recipient, or an employee or agent
>> responsible for delivering this message to 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 notify the sender immediately by replying to
>> the message, and please delete it from your system. Thank you. NYSE
>> Euronext. *
>>
>>
>> _______________________________________________
>> 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/20100610/dfc66630/attachment.html 


More information about the rules-users mailing list