IBM Tivoli Directory Integrator provides the v.6-compatible Expressions feature that allows us to compute parameters and other settings at run time, making the solutions dynamically configurable. This feature expands on the Properties handling found in previous versions.
In addition to support for simple External Properties references (fully compatible with earlier versions), Expressions provide more power in manipulating AssemblyLine and component configuration settings during AssemblyLine or component initialization and execution. Expressions can also be used for Attribute maps, as well as for Conditions and Link Criteria, alleviating much of the scripting previously required to build dynamically configured solutions. IBM Tivoli Directory Integrator provides an Expression editor to facilitate building these expressions.
The Expressions feature is built on top of the services provided by the standard Java java.text.MessageFormat class. The MessageFormat class provides powerful substitution and formatting capabilities. Here is a link to an online page outlining this class and its features: http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html.
The MessageFormat based Expressions shown in this section were the cornerstone of parameter substitution in Tivoli Directory Integrator v.6; in v.7 best practice is to use Advanced (JavaScript) expressions instead.
In addition to features described in the above class, Tivoli Directory Integrator provides a number of runtime objects that can be used in expressions—although the availability of some objects will depend on runtime state; for example, whether conn or current defined, or the error entry. The Expressions syntax provides a shorthand notation for accessing the information in these objects, like Attributes in a named entry object, or a specific parameter of a component.
TDI reference | Value | Availability |
---|---|---|
work.attrname[.index] | The work entry in the current AssemblyLine.
The optional index refers to the nth value of the attribute. Otherwise the first value is used. This Advanced attribute map: ret.value = work.getString (“givenName”) + “ “ + work.getString(“sn”);can be expressed simply as: {work.givenName} {work.sn} | AssemblyLine |
conn.attrname[.index] | The conn entry in the current AssemblyLine.
The optional index refers to the nth value of the attribute. Otherwise the first value is used. | AssemblyLine during attribute mapping |
current.attrname[.index] | The current entry in the current AssemblyLine
The optional index refers to the nth value of the attribute. Otherwise the first value is used. | AssemblyLine during attribute mapping for Modify |
config.param | The configuration object of the current component AssemblyLine. Furthermore, if config is used in the parameter of a Connector, Parser or Function, then it refers to the Config object Interface of that component, for example, JDBC Connector, or XML Parser.
param is the name of the parameter itself, as if you were to make a call to getParam() or setParam(). For example, for the JDBC Connector you could make the following reference: {config.jdbcSource] |
AssemblyLine |
alcomponent.name.param | The component Interface parameter value of a named AssemblyLine component.
name is the name of the AssemblyLine component param is the parameter name of the name object So, the following Expression: {alcomponent.DB2conn.jdbcSource}is equivalent to the following scripted call: DB2conn.connector.getParam (“jdbcSource”); | AssemblyLine |
property[:storename].name
property[:storename/bidi].name | A TDI-Properties reference.
The optional storename targets a specific Property Store. If no storename is specified, then the default store is used. name is the property name bidi will, when present, set the parameter value to forward the call to the referenced Property Store. When bidi is present no other substitution patterns or text is allowed. | Always |
JavaScript<<EOF v.6 syntax; use Advanced (JavaScipt) option in the Expression editor instead | Embedded script code used to generate a value for the Expression. This script must return a value.
The "EOF" text used here is an arbitrary string that terminates the JavaScript snippet. The JavaScript is collected until a single line with the EOF string is encountered, or no EOF is flag is set. Note that embedded JavaScript is evaluated using the script engine instance of the AssemblyLine, so we have access to all variables otherwise present for scripting. There is a shorthand form of adding JavaScript that works for input fields that do not support multiple lines (like Link Criteria or the names of Attributes in maps) and can therefore not have the necessary EOF line: {JavaScript return work.givenName + " " + work.surName} | Always |
Parent topic: General Concepts