Scripting in SDI
Security Directory Integrator provides its users with a highly-flexible engine that can be customized both from the user interface controls of the Configuration Editor, as well as through scripting of custom logic. While the user interface controls provide a means of controlling the data flow at a higher level, scripting provides you with the ability to control almost any aspect of the data flow at any level, including overriding standard SDI processing. Special functions are available in the system object to reiterate on an AssemblyLine entry, skip a Connector and start new AssemblyLines. The scripting language used for implementing this custom logic is JavaScript.
Ready-to-use, SDI provides the tools to quickly snap together the framework of an integration solution. However, for all but the most trivial migration jobs, you will need to customize and extend the built-in behavior of the product by writing JavaScript.
SDI is pure Javaâ . Whenever you issue a command to SDI, work with components and objects, or manipulate data in your flow, you are working with Java objects. SDI v7.2 uses IBM Java version 7.0.4.
Your customization on the other hand is done in JavaScript, and this marriage of two ostensibly similar, yet fundamentally different, programming languages warrants closer examination.
Experience with JavaScript will be very helpful. The examples provided may add to your experience. However, this manual does not teach JavaScript itself , merely its application in SDI. You will need to secure your JavaScript reference materials elsewhere.
There are a number of commercially available reference guides to JavaScript, as well as documentation, tutorials and examples on the net. Note however that much of the JavaScript content out on the Web is related to beautifying and automating HTML content. You need only concern yourself with the core language itself, as it is described at the following link: http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.5/guide/index.html
There is also a handy link on this site for downloading the reference in HTML format for installation locally. An excellent handbook on JavaScript is The Definitive JavaScript Guide, 4th Edition by David Flanagan (O'Reilly).
You will also want the Javadocs for Java as well, since all SDI objects, as well as the data values inside the solution, are in the form of Java objects. These documents are located online at this URL: http://docs.oracle.com/javase/1.6.0/docs/api/index.html
The J2SE documentation itself can be found here: http://docs.oracle.com/javase/1.6.0/docs/index.html Scripting is necessary when you need to add custom processing to the AssemblyLine. Examples of where scripting can be helpful include the following tasks:
Each of these cases mentioned, and many others not mentioned, usually require scripting.
- Attribute manipulation or computation
- You need to calculate the value of an output attribute based on one or more input attributes.
- Data filtering
- You want to process only entries that match a particular set of criteria.
- Data consistency or validity checking
- You need to report or correct invalid data values.
- Flow control
- You want to override the update operation of the Connector you are using.
- Initialization
- You want to run some initializing procedures before the AssemblyLine starts.
Examples
Go to the examples/scripting subdirectory of your SDI installation.
- Internal data model: Entries, Attributes and Values
- Integrating scripting into the solution
- Controlling execution with scripting
- Control points for scripting
- Java + Script ≠JavaScript