Migration considerations for parsing input attribute values
During migration from IBM® Security Verify Directory Integrator, Version 6.1.1 to Version 7.0 or later, you must consider the change in format of multivalued attributes for LDAP connectors.
In Version 6.1.1 and earlier, the values of a multi-valued attribute were output as a single line with the vertical bar (|) as the separator between the values. For example:
[10:59:13 AM CDT] E:
conn ->
eraddisplayname:John Doe,
objectclass:top|erADAccount|erManagedItem|erAccountItem,
From Version 7.0 onwards, the string representation of entries and attributes are changed to use brackets [ ], which depict the hierarchical nature of the entry or attribute in a better way.
For example, in Version 7.1.1, the same attribute is output as shown in the following example:
conn >> {
"eraddisplayname": "William S Allen",
"objectclass": [
"top",
"erADAccount",
"erManagedItem",
"erAccountItem"
],
You can use the following sample JavaScript code to parse the input attribute values, after migrating from Version 6.1.1 to Version 7.0 or later.
The following code is used in the input map that you must modify before you upgrade to Version 7.0 or later.
Version 6.1.1
var values = work.getAttribute("Name").toString().split("|");
for (var i = 0; i < values.length; i++) {
var value = values[i];
// Use value
}
Version 7.x
var values = work.getAttribute("Name").getValues();
for (var i = 0; i < values.length; i++) {
var value = values[i];
// Use value
}
Or else, you can use the following simpler code:
for ( var value in work.Name.getValues()) {
// Use value
}
The getValues() method is the suggested method for reading the values of an attribute.