Groovy makes ADF applications quicker to write than Oracle Forms!

Ok, maybe not it all cases but the following came up while doing a rewrite of some Forms code in ADF.  In Forms I had the following code:

 

formscode.png

 

The essence of this code is that if the use selects a payement type of CREDIT, then we need to select the customer's credit rating from the database and then compare that with whether it is "GOOD" or "EXCELLENT".  If not, then the order has to be a cash order.

In ADF Business Components I was able to implement the same code with this Groovy expression (the condition for executing the validator is under the "Validation Execution" tag and is newValue == "CREDIT"

 

groovy.png

This uses an association accessor to get the credit rating for the current customer and then I can use the Groovy "in" operator to check that that value is within the permitted.

Of course, not a huge difference in the number of lines of code but fundementally a cleaner implementation with the added benefit that the ADF solution would detect if you had changed the customer's credit rating but not yet commited to the database.  The Forms solution wouldn't pick that up. 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips, Tricks, Events and Information around Oracle JDeveloper, ADF, and Oracle Forms

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
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