Using functions

Our current rule only approves vacations of one day in duration, requiring all other leave requests to be manually approved. Ideally, we would like to approve holidays of varying duration as long as sufficient notice has been given, for example:

  • Approve vacations of one day in duration with a start date that's two weeks or more in the future
  • Approve if for 2-3 days and more than 30 days in the future
  • Approve if 5 days or less and more than 60 days in the future
  • Approve if 10 days or less and more than 120 days in the future

To write these rules, we will need to calculate the duration of the leave period, as well as calculate how long it is before the start date. Out of the box, the rule engine provides the Duration extension methods, ...

Get Oracle SOA Suite 11g R1 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.