[rules-users] Date equal comparison fails - don't understand why
Saloojee, Karim
karim.saloojee at fnb.co.za
Thu Feb 10 04:50:43 EST 2011
Hi
I am comparing SimpleAccount( dateAccountOpened == "5-Feb-2011")
where dateAccountOpened is "Sat Feb 05 00:00:00 GMT+02:00 2011" (if you
call toString()). The equal comparator fails (==) but the greater than
comparator passes (>) which I don't understand.
I feel I am missing something obvious here, but I have no idea what it
is.
rule "Test date equality"
when
$acc : SimpleAccount( dateAccountOpened == "5-Feb-2011")
then
System.out.println("Expected and found an account opened
on 5-Feb-2011: " + $acc);
end
rule "Some dates are more equal than others"
when
$acc : SimpleAccount( dateAccountOpened > "5-Feb-2011")
then
System.out.println("Unexpected match: " +
$acc.getDateAccountOpened());
end
Regards,
Karim
To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser:
https://www.fnb.co.za/disclaimer.html
If you are unable to access the Disclaimer, send a blank e-mail to
firstrandbankdisclaimer at fnb.co.za and we will send you a copy of the Disclaimer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DroolsDateTest.java
Type: application/octet-stream
Size: 2525 bytes
Desc: DroolsDateTest.java
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20110210/44f510bd/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DateTest.drl
Type: application/octet-stream
Size: 484 bytes
Desc: DateTest.drl
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20110210/44f510bd/attachment-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SimpleAccount.java
Type: application/octet-stream
Size: 1256 bytes
Desc: SimpleAccount.java
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20110210/44f510bd/attachment-0002.obj
More information about the rules-users
mailing list