CorrelationScript not trigerred

My correlationscript does not get triggered and only default correlation takes place when I reconcile AD > IDM. Here is how it looks like in the mapping:
“correlationScript”: {
“type”: “text/javascript”,
“globals”: {},
“file”: “script/sync/adAccount-managedUser-correlation.js”
},

What am I doing wrong here?

Thanks in advance!

Hi Tamalika,

How do you establish that the script is not triggered rather than encountering an error? Do you have added logging statements in the script to trace entries to the script, then at each point of the script for troubleshooting?

Regards
Patrick

Hi Patrick,

yes exactly, I added loggers to my script. Here is what the script looks like:

1 Like

Hi Tamalika,

I think the anonymous function construct is wrong.

The script shows:

(function () {
....
}())

and I think it should be this:

(function() {
...
})()

Regards
Patrick

1 Like

Hi Patrick,

thanks for pointing that out! I changed it and it still doesn’t trigger. I tried triggering recon from both IDM GUI and the REST call, both doesn’t trigger the function. However, recon is successful because I can see the below log output:

Hi Tamalika,

Thank you for the reconciliation status, it helps.

If you are not familiar with situations yet, please look into the documentation at : Synchronization situations and actions :: IDM 7.3.1.

The relevant information in the details you’ve posted is

  • UNASSIGNED = 2 and
  • CONFIRMED = 5,

and anything else is 0. UNASSIGNED occurs in the target phase, CONFIRMED in the source phase.
The correlation will be run by the source phase when no link exists for the source object - so that to determine if there is an existing target: if yes (source = 1, link = 0, target = 1) then situation = FOUND, otherwise (1, 0, 0) it is ABSENT. In your case, both are 0. The point here is that it is likely that the script is not run because the reconciliation does not have to. Your first reconciliation probably has triggered the script because the link table was empty - but that script was doing nothing due to the error in the immediately called function construct; and now, because all targets have all already been created, the script is never triggered.

In a development environment, to test reconciliation mappings, the best is to always start clean at each iteration, using one of these means:

  • If you are testing in a local environment, re-install IDM from scratch (e.g clear/re-install the repo DB)
  • Or delete all records in the reconciliation link table and delete all target objects (using the REST api)
  • Or issue a reconciliation with temporary setting: ACTION=DELETE for SITUATION=CONFIRMED, and you can ignore the UNASSIGNED situation.

See then if with a clean state, the correlation script is invoked. I hope this helps,

Regards
Patrick

1 Like