Thursday Aug 30, 2012

Comparing Dates in Oracle Business Rule Decision Tables

I have been working with decision tables for some time but have never had a scenario where I need to compare dates. The use case was to check if a persons membership had expired. I didn't think much of it till I started to develop it. The first trap I feel into was trying to create ranges and bucket sets. The other trap I fell into was not converting the date field to a complete date. This may seem obvious to most people but my Google searches came up with nothing so I thought I would create a quick post.

I assume everyone knows how to create a decision table so I'm not going to go through those steps. The prerequisite for this post is to have a decision table with a payload that has a date field. This filed must have the date in the following format YYYY-MM-DDThh:mm:ss.

  1. Create a new condition in your decision table
  2. Right-click on the condition to edit it and select the expression builder



  3. In the expression builder, select the Functions tab.
  4. Expand the CurrentDate file and select date, and click Insert Into Expression button.



  5. In the Expression Builder you need to create an expression that will return true or false, add the operation <= after the CurrentDate.date



  6. In my scenario my date field is memberExpire, Navigate to your date field and expand, select toGregorianCalendar().



  7. Your expression will look something like this, click OK to get back to the decision table



  8. Now its just a matter of checking if the value is true or false.

Simple when you know how :-)


About

Discussions and Examples using Oracle Fusion Middleware. Some image links are broken when using Firefox, Safari, and Chrome. If you want to see the full image please use IE.

Twitter:@james8001

tumblr hit counter vistors, thanks for your support

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today