Debug Your Groovy Scripts
Use the Groovy script debugger in Application Composer to debug the object functions and validations that you defined for an object. While debugging, you can also examine object and attribute values.
Access the Groovy Script Debugger
Access the Groovy script debugger from either the Custom Objects or Standard Objects page in Application Composer.
To access the debugger:
- In Application Composer, in the Objects tree, click either the Custom Objects or Standard Objects link.
- On the resulting Objects page for either custom or standard objects, select the
object that you want to debug and then click the debugger icon in the table's
toolbar.
The debugger icon is a ladybug.
- On the debugger UI, examine the object functions and validations defined in Groovy for that object.
Use the Groovy Script Debugger
The Groovy script debugger contains multiple regions, described in the following table, which you can use to debug your scripts for an object:
Debugger Region |
Description |
---|---|
Main toolbar |
From the toolbar, you can select the object to examine and start the debugging process. |
Left pane region |
This region displays the object functions and validations defined for the selected object. |
Main script region |
This region displays the selected Groovy script. |
Stack region |
This region displays the call stack. For example, assume there are two functions, Function1 and Function2. Function1 calls Function2. When debugging within Function2, the Stack region displays which statement from Function2 is currently being executed, as well as information about the parent Function1 from where Function2 was called. |
Variables region |
This region displays variables and associated values. |
Breakpoints tab |
This tab displays which statement (line number) has a breakpoint. A breakpoint is a location in a Groovy script where you want the script to pause during debugging. The debugger stops at that statement. |
Log tab |
This tab displays all logs. If the script has any |
To use the debugger:
- In Application Composer, in the Objects tree, click either the Custom Objects or Standard Objects link.
- On the resulting Objects page for either custom or standard objects, select the object that you want to debug and then click the debugger icon in the table's toolbar.
- On the debugger UI, the left pane displays the object functions and validations
defined in Groovy for that object. Select the script that you want to review.
The script is displayed in the main script region.
- To start debugging, click one of these icons in the toolbar:
- Step Over
Review one statement in the selected script at a time.
- Step Into
If a statement in execution is a call to some function, and you want to debug inside that function, then click Step Into.
- Step Out
If you're debugging inside a child function and you want to move the control back to the parent function, then click Step Out.
- Run
Move to the next breakpoint in the script. If no further breakpoints exist, then the debugger completes its evaluation of the selected script and then closes the debugger session.
- Step Over
Enable or Disable the Groovy Script Debugger
The Groovy script debugger is enabled by default. However, to hide the debugger, or later show it again, then set the ADF: Enable Script Debugger profile option.
To set the ADF: Enable Script Debugger profile option:
-
In the Setup and Maintenance work area, go to:
. - In the Profile Display Name field, enter
ADF: Enable Script Debugger
and click Search. - In the Profile Values region, at the Site level, enter either
TRUE
orFALSE
.- TRUE displays the debugger.
- FALSE hides the debugger.