IDM 7.2.2

Create script

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

A create script creates a new object on the external resource. If your connector does not support creating an object, this script should throw an UnsupportedOperationException.

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

Input variables

The following variables are available to a create script:


A handler to the connector’s configuration object.


A handler to the Operation Options.


An OperationType that corresponds to the action (CREATE).


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


The set of attributes that describe the object to be created.


The UID of the object to be created, if specified. If the UID is null, the UID should be generated by the server. The UID corresponds to the ICF __NAME__ attribute if it is provided as part of the attribute set.


A logger instance for the connector.


The user unique ID (ICF __UID__) of the newly created object. The type of the returned UID must be a string or a Uid. If a null value or an object type other than string or Uid is returned, the script must throw an exception.

Create Script
def operation = operation as OperationType
 def configuration = configuration as SapConfiguration
 def log = log as Log
 def objectClass = objectClass as ObjectClass
 def createAttributes = new AttributesAccessor(attributes as Set<Attribute>)
 def name = id as String
 def options = options as OperationOptions"Entering {0} script",operation);

 assert operation == OperationType.CREATE, 'Operation must be a CREATE'
 // We only deal with users
 assert objectClass.getObjectClassValue() == ObjectClass.ACCOUNT_NAME

 def password = createAttributes.getPassword() as GuardedString;
 assert password != null, 'Password must be provided on create'

 def uid = createTheUser(createAttributes);
 return uid
Copyright © 2010-2023 ForgeRock, all rights reserved.