- Q. What variables can be used in scripts?
- Q. How can I use the identityServer variable in scripts?
- Q. When do onUpdate scripts run?
- Q. How can I use a postAction script?
- Q. How can I troubleshoot scripts?
- Q. How do I invoke reconciliation (or any other http operation) via REST using a script?
- Q. Can I use custom Java packages in scripts?
- Q. How do I call a Groovy script from another Groovy script?
A. The variables that can be used in scripts depend on the triggers that launch the script. The available variables are detailed in the Scripting Guide › Script Variables.
It can also be used to return values of specific properties using getProperty, as used in the crypto.js and policyFilter.js files (located in the /path/to/idm/bin/defaults/script directory).
See Scripting Guide › Script Variables for further information on the identityServer variable
A. onUpdate scripts run before the LiveSync update completes and run regardless of whether the source object has changed or not. The onUpdate script must always execute because it is possible for the onUpdate action to modify the source object itself based on some business logic.
See Object Modeling Guide › Managed Object Configuration for further information on when scripts run.
A. postAction scripts are used in the sync.json file, where you can associate them with a specific situation and action for a policy. The postAction script is invoked when the corresponding action for the specific policy situation has completed, thereby allowing you to automatically trigger an action upon completion of a related action.
The postAction script is not triggered if the action is set to either IGNORE or ASYNC.
See Synchronization Guide › Synchronization Situations and Actions and Synchronization Guide › Policy Objects for further information.
You can also debug your Groovy scripts as detailed in How do I debug server-side Groovy code in IDM (All versions)?
For example, an external REST call via a script would look similar to this:openidm.action("external/rest", "call", params);
Where the call parameter specifies the action name to be used for invoking the http operation.
See External Services Guide › Access External REST Services for further information.
External transformation and conditional scripts do not work when you view sample data, but do work if you process the data by performing a reconciliation. As a workaround for viewing sample data, you can include the script inline rather than as an external script.
This defaults to 60000 (60 seconds), which means any changes made to scripts are not picked up for up to 60 seconds.
If you are developing scripts, you can reduce this interval to see your changes quicker. See Scripting Guide › Script Configuration for further information.
- If your package name is: custom.package.name
A. This is described in How do I call one Groovy script from another in IDM (All versions)?