Thursday, October 10, 2013

That's Groovy!

I think a little known feature of ADF is the ability to use Groovy expressions in the ADF Business Components layer. You can use Groovy expressions for the following:
• Values for view and entity objects attributes
• Validation rules on entity object attributes
• Expressions for error messages
• Values for view object bind variables
• View object transient attribute validation

If you haven't already I highly recommend reading the Introduction to Groovy Support in JDeveloper
and Oracle ADF 11g whitepaper at the following link: http://www.oracle.com/technetwork/developer-tools/jdev/introduction-to-groovy-128837.pdf

Since the Groovy expressions are run inside of the JVM you can make use of any Java libraries and classes that exist there. Groovy expressions can be simple or complex and there are also a variety of expressions built into ADF such as adf.currentDate and adf.context.securityContext.userName. These would allow you to set the date and user on attributes at the VO level when not using history columns.

No comments:

Post a Comment