Monday, September 13, 2010

Function to find age in years in Oracle Business Rules

I was part of a discussion recently - can age be found within business rules or can bpel do the math and get it for business rules. Business rules is not less incompetent and it does offer capability to mathematical calculations or so called numerical manipulations.

I had a date captured in a tag of type String and sent to business rules. I had to find the age from the date received in input. I have written a function in business rules that can get this done. Essentially the date is converted from string to date and then a difference in dates, will get you the result as an integer.

Duration.years between(OracleDate.from string(arg_1.IP1),RL.date.get current())










Peace!

Cheers,
-AR

No comments:

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License