Question & Answer
Question
Why is the After Lookup executed when Multiple Entries are found when the hovering context sensitive dialog implies it is only executed when a single entry is found?
Cause
The After Lookup is executed when Connector.setCurrent() function has been set.
Answer
Consider the example for an LDAPConnector where multiple entries are returned from a Lookup.
When hovering over the After Lookup text in the Configuration Editor, the text
- " Execute after a single entry was found during lookup."
might be interpreted as the script node would not be executed when multiple entries are found.

The flow diagrams available in the Info Center provide a graphical representation of the flow. In this example, once current entry has been set, the flow will continue to Match Found? then the After Lookup Node is executed.

For example:
An LDAPConnector is defined in Lookup Mode where the Link Criteria is cn equals *
The On Multiple Entries contains:
- task.logmsg(" ")
task.logmsg(" Inside On Multiple Entries Found...")
var currEntry = thisConnector.getFirstDuplicateEntry();
task.logmsg(" ==== >>> getFirstDuplicateEntry >> " + currEntry)
thisConnector.setCurrent(currEntry);
task.logmsg(" ==== >>> thisConnector.setCurrent has been set to thisConnector.setCurrent(currEntry) " )
task.logmsg(" ")
And After Lookup contains:
- task.logmsg(" ")
task.logmsg(" =====>> Inside After Lookup")
task.logmsg(" =====>> This is the current Entry >> " + currEntry)
task.logmsg(" ")
RESULTS OF EXECUTION in console log will show:
- 12:42:21,890 INFO -
12:42:21,890 INFO - Inside On Multiple Entries Found...
12:42:21,890 INFO - ==== >>> getFirstDuplicateEntry >> {
- "$dn": "eroid=1.3.6.1.4.1.6054.1.1.1,ou=constraints,ou=itim,DC=COM",
"ercustomconstraint": [
"enum$active$0",
"enum$inactive$1"
],
"eroid": "1.3.6.1.4.1.6054.1.1.1",
"objectclass": [
"top",
"erattributeconstraint"
],
"cn": "erOrgStatus"
}
12:42:21,906 INFO - =====>> This is the current Entry >> {
- "$dn": "eroid=1.3.6.1.4.1.6054.1.1.1,ou=constraints,ou=itim,DC=COM",
"ercustomconstraint": [
"enum$active$0",
"enum$inactive$1"
],
"eroid": "1.3.6.1.4.1.6054.1.1.1",
"objectclass": [
"top",
"erattributeconstraint"
],
"cn": "erOrgStatus"
Whereas, when the setCurrent() has not been invoked, the After Lookup is not executed.
- task.logmsg(" Inside On Multiple Entries Found...")
var currEntry = thisConnector.getFirstDuplicateEntry();
task.logmsg(" ==== >>> getFirstDuplicateEntry >> " + currEntry)
// Comment the next two lines, and After Lookup WILL NOT BE EXECUTED.
//thisConnector.setCurrent(currEntry);
//task.logmsg(" ==== >>> thisConnector.setCurrent has been set to thisConnector.setCurrent(currEntry) " )
task.logmsg(" ")
Related Information
[{"Product":{"code":"SSCQGF","label":"Tivoli Directory Integrator"},"Business Unit":{"code":"BU008","label":"Security"},"Component":"General","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0;7.1","Edition":"","Line of Business":{"code":"LOB24","label":"Security Software"}}]
Product Synonym
tdi;after lookup;setCurrent
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21503357