When Tivoli® Directory Integrator components access information from connected systems, they convert the data from system-specific types to an internal representation using Java objects. On output, components convert the other way, going from this internal data model to the native types of the target system. This same internal representation is used when you wish to pass data to and from AssemblyLines. It is therefore vital that you understand how the Tivoli Directory Integrator internal data model works.
var oc = system.newAttribute( "objectClass" );
oc.addValue( "top" );
oc.addValue( "person" );
oc.addValue( "organizationalPerson" );
oc.addValue( "inetOrgPerson" );
ret.value = oc;
Attributes themselves are collected in a data storage object called an entry object. The entry is the primary data carrier object in the system and Tivoli Directory Integrator gives you access to important entry objects by registering them as script variables. A prime example is the Work entry object in the AssemblyLine, used to pass data between AL components (as well as between AssemblyLines). This entry object is local to each AssemblyLine and available as the script variable work.
ret.value = [ "top", "person", "organizationalPerson", "inetOrgPerson" ];
The advanced mapping feature supports JavaScript arrays and Entries for passing multiple attribute values.
ret.val = anentry;
for the Attribute
called "last". Let us further assume that work is empty to
start with, and anentry contains the Attributes "cn", "sn"
and "mail".var oc = system.newAttribute( "objectClass" );
oc.addValue( "top" );
oc.addValue( "organizationalUnit" )
work.setAttribute( oc );
oc.addValue( ["top", "organizationalUnit"] ); // Does not work like Advanced Mapping
This code will result in the oc attribute getting a single value, which in turn is an array of strings.
Entry objects can also contain properties. Properties are data containers like Attributes, except that they are only single-valued. While Attributes are used to store data content, properties hold parametric information, allowing you to keep this information separated. Properties do not show up for attribute map selection or in the Work entry list, but can be accessed much like Attributes from script. entry functions like getProperty() and setProperty() are used for this, and these work directly with Property values, which can be any type of Java object, just like Attribute values. There is no intermediate Property object as there is when you work with Attributes.
In many cases, you can restrict the data model to an entry containing zero or more Attributes, each with zero or more values—a flat schema.
This is one of the strengths of Tivoli Directory Integrator: simplifying and harmonizing data representations and schema. It also represents a challenge when you need to handle information with a more complex structure. However, since an Attribute value can be any type of Java object, including another entry object (with its own Attributes and values), Tivoli Directory Integrator allows you to work with hierarchically structured data.
This more elaborate and structured way of handling hierarchical objects is described in Working with hierarchical Entry objects.
// this is the entry to return
e = system.newEntry();
e.setAttribute("some", "value");
// Create an Attribute object. We don't need to provide a name since the mapping will use current map's name.
attr = system.newAttribute(null);
// add the entry to the Attribute object and return that instead of the Entry object
attr.addValue(e);
return attr;
If this was entered as the Advanced Attribute
Map for the "last" Attribute, then after Attribute Mapping, the work Entry
will now contain an Attribute called "last". This Attribute is an
Entry, in turn comprised of two attributes called "some" and "value".