OK, in DRL terms this would be something like this (I've not checked the
syntax, but it gives you an idea):-
function boolean isTooOld(Calendar usd, Calendar crd, int age) {
crd.add(Calendar.DAY_OF_YEAR, age);
return crd.after(usd);
}
rule "old claims"
when
Parameters( $usd : userSpecifiedDate, $param : maxAge )
Claim( $crd : claimRequestDate )
eval(isTooOld( $usd, $crd, $param ) )
then
System.out.println("that's an old claim");
end
I used a function to increase readibility. You could have placed the logic
in-line or a helper function on a domain object.
You should then be able to convert this into a decision table.
With kind regards,
Mike
On 24 February 2011 11:08, sdinoo <sdinoo(a)gmail.com> wrote:
lets say instead of =now() I am using a user-specified date(usd). I want to
calculate (usd - claimRequestDate) in the Condition something like <usd -
ClaimREquestDate) > "$param"
I the data for that condition I want to put an integer say 65 - the rule
should fire when the condition is met
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Date-Condition-in-Dec...
Sent from the Drools - User mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users