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
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-Decision-tables-tp2565936p2566732.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users