One way:

Risk
transactionDate
compare tD to...
attachmentDate
someOtherDate

The "==" is added automatically. Leave the cell in the column empty to omit constraint for a rule.

If you need a choice between this constraint and no constraint, you may use

Risk
transactionDate == attachmentDate /*$param*/
tD eq aD
x

and leave the cell in the column empty to omit constraint for a rule.

-W






On 6 February 2011 15:12, David Smith <mail@davesmith.me.uk> wrote:
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
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users