[rules-users] Drools: how do I compare two fields in a Decision Table

David Smith mail at davesmith.me.uk
Sun Feb 6 09:12:03 EST 2011


Hi,

How do I compare two fields in a decision table e.g.
transactionDate==attachmentDate

I can create a rule that has a restriction using two fields such as

rule "check if risk is active"
when
    $risk : Risk(transactionDate==attachmentDate)
then
    ...
end

I can do this using an eval statement in a decision table

Condition
$risk:Risk
eval($risk.getAttachmentDate().equals($risk.getTransactionDate()))

How do I write this without an eval?
I want to write something similar to the rule above:

Condition
$risk:Risk
attachmentDate == transactionDate

Thanks
David



More information about the rules-users mailing list