Application Composer Series: Where and When to use Groovy
Posted
by Richard Bingham
on Oracle Blogs
See other posts from Oracle Blogs
or by Richard Bingham
Published on Thu, 29 May 2014 09:12:09 +0000
Indexed on
2014/05/29
9:36 UTC
Read the original article
Hit count: 275
/Oracle
This brief post is really intended as more of a reference than an article. The table below highlights two things, firstly where you can add you own custom logic via groovy code (end column), and secondly (middle column) when you might use each particular feature. Obviously this applies only where Application Composer exists, namely Fusion CRM and Oracle Sales Cloud, and is based on current (release 8) functionality.
Feature |
Most Common Use Case |
Groovy |
Field Triggers |
React to run-time data changes. Only fired when the field is changed and upon submit. |
Y |
Object Triggers |
To extend the standard processing logic for an object, based on record creation, updates and deletes. There is a split between these firing events, with some related to UI/ADF actions and others originating in the database.
UI Trigger Points:
Database Trigger Points:
|
Y |
Field Validation |
Displays a user entered error message based groovy logic validating the field value. The message is shown only when the validation logic returns false, and the logic is triggered only when tabbing out of the field on the user interface. |
Y |
Object Validation |
Commonly used where validation is needed across multiple related fields on the object. Triggered on the submit UI action. |
Y |
Object Workflows |
All Object Workflows are fired upon either record creation or update, along with the option of adding a custom groovy firing condition. | Y |
Field Updates - change another field when a specified one changes. Intended as an easy way to set different run-time values (e.g. pick values for LOV's) plus the value field permits groovy logic entry. | Y |
|
E-Mail Notification - sends an email notification to specified users/roles. Templates support using run-time value tokens and rich text. | N |
|
Task Creation - for adding standard tasks for use in the worklist functionality. | N |
|
Outbound Message - will create and send an XML payload of the related object SDO to a specified endpoint. | N |
|
Business Process Flow - intended for approval using the seeded process, however can also trigger custom BPMN flows. | N |
|
Global Functions |
Utility functions that can be called from any groovy code in Application Composer (across applications). |
Y |
Object Functions | Utility functions that are local to the parent object. Usually triggered from within 'Buttons and Actions' definitions in Application Composer, although can be called from other code for that object (e.g. from a trigger). | Y |
Add Custom Fields |
When adding custom fields there are a few places you can include groovy logic. |
Y |
|
Default Value - to add logic within setting the default value when new records are entered. | Y |
Conditionally Updateable - to add logic to set the field to read-only or not. |
Y |
|
|
Conditionally Required - to add logic to set the field to required or not. |
Y |
|
Formula Field - Used to provide a new aggregate field that is entirely based on groovy logic and other field values. |
Y |
Simplified UI Layouts - Advanced Expressions |
Used for creating dynamic layouts for simplified UI pages where fields and regions show/hide based on run-time context values and logic. Also includes support for the depends-on feature as a trigger. |
Y |
Related References
- This Blog: Application Composer Series
- Extending Sales Guide: Using Groovy Scripts
- Groovy Scripting Reference Guide
© Oracle Blogs or respective owner