[rules-users] Data comparing in CONDITION column decision table

Sumeet Karawal sumeet.karawal at tcs.com
Thu Mar 15 03:28:28 EDT 2012


Hi,

Can we use a data value of another object in the condition column of a
Spreadsheet.

For example: I have two data types(POJOs) one com.bank.Customer and other
com.bank.Account

in the rules I want to check whether the value entered for a particular
field in Customer class is equal to the value entered for the corresponding
field in the Account class. eg Customer.accType = Account.accType()


How can we achieve this using Decision table (CONDITION Column). I have
tried this:

            -------------------------------------------- 
           |RuleTable                                    
           |Discount                                     
            -------------------------------------------- 
           |CONDITION      |CONDITION                   |
            ---------------+----------------------------|
           |$a : Account   |$c : Customer               |
            ---------------+----------------------------|
           |               |type == "$param"             
 ----------+---------------+---------------------------- 
| Discount |    Account    |            Type            |
|  Rules   |               |                            |
|----------+---------------+----------------------------|
|    1     |               |        $a.getType()        |
|----------+---------------+----------------------------|
|    2     |               |        $a.getType()        |
|----------+---------------+----------------------------|
|    3     |               |        $a.getType()        |
|----------+---------------+----------------------------|
|    4     |               |        $a.getType()        |
|----------+---------------+----------------------------|
|    5     |               |        $a.getType()        |
|----------+---------------+----------------------------|
|    6     |               |        $a.getType()        |
|----------+---------------+----------------------------|




But it won't work. It would be great if somebody could help me on this.

Thanks & Regards,
Sumeet Karawal
Mailto: sumeet.karawal at tcs.com

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you






More information about the rules-users mailing list