IDM 7.2.2

Update script

Connectors continue to be released outside the IDM release. For the latest documentation, refer to the ICF documentation.

An update script updates an object in the external resource. Connectors that do not support update operations should throw an UnsupportedOperationException.

A sample update script for an SQL database is provided in openidm/samples/scripted-sql-with-mysql/tools/UpdateScript.groovy.

Input variables

The following variables are available to an update script:


A handler to the connector’s configuration object.


A handler to the Operation Options.


An OperationType that corresponds to the action (UPDATE).


The object class that is updated, such as __ACCOUNT__ or __GROUP__.


A collection of ConnectorAttributes that represent the entry attributes to update.


The UID of the object to be updated. The UID corresponds to the OpenICF UID attribute.


The name of the object to be updated (optional). The id corresponds to the ICF __NAME__ attribute. It will not be injected and set unless the update is a rename.


A logger instance for the connector.


The user unique ID (ICF __UID__) of the updated object. The type of the returned UID must be a string or a Uid. If the UID is not modified by the update operation, return the value of the uid injected into the script.

Update Script
def operation = operation as OperationType
def updateAttributes = attributes as Set<Attribute>
def configuration = configuration as ScriptedConfiguration
def id = id as String
def log = log as Log
def objectClass = objectClass as ObjectClass
def options = options as OperationOptions
def uid = uid as Uid

switch (operation) {
    case OperationType.UPDATE:
        switch (objectClass) {
            case ObjectClass.ACCOUNT:
// ...
                    for (Attribute a : updateAttributes) {
                        if ( {
// ...
return uid
Copyright © 2010-2023 ForgeRock, all rights reserved.