FR IDM – manager context during implicit sync transformation script

This topic has 0 replies, 1 voice, and was last updated 5 months, 2 weeks ago by akumar101.

  • Author
    Posts
  • #28530
     akumar101
    Participant

    Hello,

    I need to populate manager attribute in target ldap in DN format. I’ve written a small groovy script for the transformation.

    source: “manager”

    =======================
    if (source != null) {
    logger.trace(“Source is :::: (1)” + source)

    String idmFilter = “/_id eq \”” + source._refResourceId + “\””

    def idmManagerObj = openidm.query(“managed/user”, [“_queryFilter”: idmFilter], [“userName”])
    if (idmManagerObj.resultCount == 1) {
    logger.info(“Manager found :::: (2)” + idmManagerObj.result[0].userName)
    }
    …..
    ===================

    Error in logs:
    ————–
    WARNING: Property mapping /manager transformation script encountered exception
    org.forgerock.openidm.script.ScriptThrownException: Cannot get property ‘userName’ on null object in file:/opt/openidm/script/ImplicitManager.groovy
    at org.forgerock.openidm.script.groovy.GroovyScript.eval(GroovyScript.java:237)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    Any pointers will be greatly appreciated.

    Thanks,

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

©2021 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?