66
IBM Directory Integrator 4.7: Getting Started Guide

IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

IBM Directory Integrator 4.7:Getting Started Guide

���

Page 2: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple
Page 3: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

IBM Directory Integrator 4.7:Getting Started Guide

���

Page 4: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

NoteBefore using this information and the product it supports, read the general information under “Notices” on page 53.

First Edition (August 2002)

This edition applies to version 4, release 7, of The IBM® Directory Integrator and to all subsequent releases andmodifications until otherwise indicated in new editions.

© Copyright International Business Machines Corporation 2002. All rights reserved.US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.

Page 5: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Contents

Preface . . . . . . . . . . . . . . . vAbout this manual . . . . . . . . . . . . vScripting languages . . . . . . . . . . . . viInstalling IBM Directory Integrator 4.7 . . . . . viInstalling the tutorial files. . . . . . . . . . vi

Chapter 1. Simplify and solve . . . . . 1How do you eat an elephant?. . . . . . . . . 1To integrate is to communicate . . . . . . . . 1AssemblyLines . . . . . . . . . . . . . 6Connectors . . . . . . . . . . . . . . . 7Parsers . . . . . . . . . . . . . . . . 9

Chapter 2. Introducing IBM DirectoryIntegrator 4.7 . . . . . . . . . . . . 13Rapid integration development . . . . . . . . 13

Creating a new configuration file . . . . . . . 14Creating an AssemblyLine . . . . . . . . . 17Adding the Input Connector. . . . . . . . . 20Mapping Attributes Into The AssemblyLine . . . 25Adding the Output Connector . . . . . . . . 32Running your AssemblyLine . . . . . . . . 34Working with Hooks . . . . . . . . . . . 38Schema conversion . . . . . . . . . . . . 41Adding the Join Connector . . . . . . . . . 44Setting up Link Criteria . . . . . . . . . . 45Final thoughts . . . . . . . . . . . . . 51

Appendix. Notices . . . . . . . . . . 53Trademarks . . . . . . . . . . . . . . 54

© Copyright IBM Corp. 2002 iii

Page 6: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

iv IBM Directory Integrator 4.7: Getting Started Guide

Page 7: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Preface

About this manualThis book is a simple introduction to a simple system. Make no mistake; the word`simple’ is used here in its most positive and powerful context, because the bestway to wrap our minds around a complex problem is to break it down intosimpler, more manageable bits and then master these constituent parts. Divide andconquer. And this applies equally to the problems related to engineeringinformation exchange across an office, an enterprise or the globe.

Reducing the complexity of an integration problem means unraveling the intricateweave of information flows and examining them one thread at a time; Studyingtheir direction and content, as well as the part of the patchwork to which theybelong. But this isn’t much help if the integration tools we use don’t let us expressour understanding of the problem in these terms. That’s where IBM DirectoryIntegrator 4.7 comes in, helping you preserve simplicity by giving you the tools to:v Implement your integration solution in terms of individual threads of

communication (the data flows) between systems and devicesv Create, test and deploy each flow rapidly, and with immediate feedbackv Easily maintain and grow your solution as your organization and the world

around it changes

This means that integration projects become easier to estimate and plan, oftensimply a matter of counting and costing the individual data flows to beimplemented. And since you are developing the solution flow-by-flow visually andinteractively, you can report and demonstrate status to both project and corporatemanagement at any time.

Furthermore, IBM Directory Integrator 4.7 manages the technicalities of connectingto and interacting with the various data sources that you want to integrate,abstracting away the details of their APIs, transports, protocols and formats.Instead of focusing on data, IBM Directory Integrator 4.7 lifts your view to theinformation level, allowing you to concentrate on the business and informationmanagement logic needed to perform each exchange.

IBM Directory Integrator 4.7 also lets you build and maintain libraries ofintegration logic and components that can be reused to address new challenges.Development projects across your organization can all share IBM DirectoryIntegrator 4.7 assets, resulting in independent projects (even point solutions) thatimmediately fit into a coherent, integrated integration infrastructure.

Finally, this approach results in a more rational and predictable use of resources,since you only bring in your data source and technology experts at the very startof a project in order to set up your library of communication components. Once inplace, these integration assets, although centrally managed, are available across thenetwork, letting you leverage them to create new solutions and enhancing existingones.

This document gives you an introduction to our approach, as well as how to tapinto the radical and elegant simplicity of IBM Directory Integrator 4.7.

© Copyright IBM Corp. 2002 v

Page 8: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Scripting languagesIBM Directory Integrator 4.7 allows you to choose from a wide selection ofscripting languages, including JavaScript™, VBScript and PerlScript. In fact, anyscripting language that plugs into the Windows® Scripting Host under Windows orthe Beans Scripting Framework under UNIX® may be used.

For more information about scripting languages, please see the IBM DirectoryIntegrator 4.7: Reference Guide.

Installing IBM Directory Integrator 4.7For more information about installing the IBM Directory Integrator 4.7, please see″IBM Directory Integrator 4.7 installation instructions″ in the IBM DirectoryIntegrator 4.7: Reference Guide.

Installing the tutorial filesIn order to work with the examples in this manual, you must refer back to theinstallation package to download the necessary files. You can complete the firstpart of the Getting Started tutorial without them.

To access these example files, go to the %IBMDI_ROOT%/sample directory in theinstallation directories.

vi IBM Directory Integrator 4.7: Getting Started Guide

Page 9: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Chapter 1. Simplify and solve

How do you eat an elephant?The answer is: one bite at a time. The same approach applies equally well to anintegration or systems deployment project.

The key to success is to reduce complexity by breaking the problem up intosmaller, manageable pieces. This means starting with a portion of the overallsolution, preferably one that can be completed in a week or two. Ideally, thisshould also be a piece that can be put independently into production. That way,it’s already providing return on investment while you tackle the rest.

Once you have isolated the piece you are going to work with, simplify it furtherby isolating the basic units of communication, the data flows themselves, and youare poised to start implementing them using IBM Directory Integrator 4.7.

Integration development is done with IBM Directory Integrator 4.7 through a seriesof try-test-refine cycles, making the process an exploratory one. This not only helpsyou to discover more about your own installation, but also lets you grow yourintegration solution as your understanding of the problem set grows.

A great way to get a good mental picture of the problem at hand is to make apicture of it. Grab a pencil and a piece of paper (and an eraser) and sketch out aflow diagram that maps out the solution in broad strokes. This exercise not onlyhelps you to visual the scope of the task, it serves as the blueprint forimplementing it in IBM Directory Integrator 4.7.

To integrate is to communicateIntegration problems are all about communication, and as such can typically bebroken down into four parts: The systems and devices that are to communicate,when they’re supposed to talk, what they should say to each other and how theyshould say it. These four constituent elements of a communications scenario can bedescribed as follows:

Data Sources

These are the data repositories, systems and devices that talk to each other.Like that Enterprise Directory you’re implementing or trying to maintain;or your CRM application; or the office phone system; or maybe that Accessdatabase with the list over company equipment and to whom it’s beenissued.

Data sources represent a wide variety of systems and repositories, likedatabases (Oracle, DB2®, SQL Server), directories (iPlanet, IBM DirectoryServer, ActiveDirectory), directory services (for example, Exchange), files(XML, LDIF or SOAP documents), specially formatted email, or anynumber of interfacing mechanisms that internal systems and externalbusiness partners use to communicate with your information assets andservices.

Events

© Copyright IBM Corp. 2002 1

Page 10: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Events can be described as the circumstances that dictate when one set ofdata sources is to talk to another. One example is whenever an employee isadded to, updated or deleted from the HR system. Or when the accesscontrol system detects a keycard being used in a restricted area. An eventcan also be based on a calendar/clock based timer, for example, startingcommunications at 12:00 midnight, every day except on Sundays. It couldeven be a one-off event like populating a directory.

Events are usually tied to a data source, and are related to the data flowsthat are triggered when the specified set of circumstances arise.

Data Flows

These are the threads of the conversations and their content, and areusually drawn as arrows which point in the direction of data movement.

Each data flow represents a unique message being passed from one set ofdata sources to another.

Attribute Mapping and Transformation

It goes without saying that for a conversation to be meaningful to allparticipants, everyone involved must understand what is being said. Butwe can probably count on our data sources representing their data contentin a different ways. One system might represent a telephone number astextual information, including the dashes and parentheses used to makethe number easier to read. Another one might store them as numericaldata.

If these two systems are to talk together about this data, then theinformation must be translated during the conversation. Furthermore, theinformation in one source might not be complete, and might need to beaugmented with attributes from other data sources. Furthermore, onlyparts of the data in the flow might be relevant to some of our outputsources.

Choosing which fields or attributes are to be handled in a data flow, orpassed on to a data source, as well as how each connected system refers toand represents this information, is called Attribute Mapping.

There are many diagramming conventions and styles available to choose from, butthe actual shape and type of symbols is less important than your understanding ofthe problem. Use boxes or balls or bubbles or whatever you’re comfortable with,but be consistent and be sure to label everything clearly and legibly. That way,when you look at your diagram in a couple of months (or when someone elsedoes), it still makes sense. Let’s start our first IBM Directory Integrator 4.7 tutorialby doing a simple a flow diagram:

2 IBM Directory Integrator 4.7: Getting Started Guide

Page 11: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Here we see the third data source (DS3) getting data from DS1. Along the way, thedataflow also aggregates information from a second source (DS2).

First off, it’s important to understand that each AssemblyLine implements a singleuni-directional data flow. If we wish to do bi-directional synchronization betweentwo or more data sources, then we must use a separate AssemblyLine for handlingthe flow in each direction. The reason for this is that the form and content of thedata, as well as the operations carried out on it, most likely are different for eachdirection.

Note: IBM Directory Integrator 4.7 is fully featured for creating request-responseinformation solutions like Web Services.

For more information about scripting languages, please see the IBMDirectory Integrator 4.7–Reference Guide.

Chapter 1. Simplify and solve 3

Page 12: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Although there are no limits to the number of Connectors that an AssemblyLinecan contain, our AssemblyLines should be made up of as few Connectors aspossible (for example, one per data source participating in the flow), while at thesame time including enough components and script logic to make theAssemblyLine as autonomous as possible. The reasoning behind this is primarily tomake the AssemblyLine easy to understand and maintain. It also results in simpler,faster and more scalable solutions.

The philosophy is all about dealing with the flows one at a time, simplifying theproblem set, so we’ll zoom in on the flow going from DS1 to DS3. This arrowcould describe the operation of populating the directory, or migrating data fromone type (or version) of data store to another.

4 IBM Directory Integrator 4.7: Getting Started Guide

Page 13: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Our next step is to detail the data that is sent.

Some data sources, like databases, view data as records that are made up of anumber of fields. Directories on the other hand handle entities , each of whichcontains a number of attributes. In addition, these two types of sources usedifferent sets of predefined data types.

But we don’t really have to worry about how the data is stored in the sources: IBMDirectory Integrator 4.7 takes care of that for us. Everything that gets pulled intoour data flow is converted to a canonical format: Java™ objects, so that once insidethe AssemblyLine, all data elements are called attributes, share the same set ofdata types and can be dealt with in a generic fashion.

In order to complete our visualization of the data flow, we’ll record how theattributes of the input data source are mapped (and possibly modified) to becomethe attributesof the output destinations.

Chapter 1. Simplify and solve 5

Page 14: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

To keep our example simplel, we’ll be using a comma-separated value file as ourDS1 that contains the fields First , Last and Title. Our output data source (DS3) isan XML document.

Now that we have a good representation of our solution, let’s take a look at howIBM Directory Integrator 4.7 handles data flows.

AssemblyLinesThe data flow arrows in our diagram translate in IBM Directory Integrator 4.7 toAssemblyLines, which work in a similar fashion to real-world industrial assemblylines.

Real-world assembly lines are made up of a number of specialized machines thatdiffer in both function and construction, but have one significant attribute incommon: they can be linked together to form a continuous path from inputsource(s) to output.

An assembly line generally has one or more input units designed to accept fishfillets, cola syrup, car parts -- whatever the raw materials needed for productionare. These ingredients are processed and merged together. Sometimes by-productsare extracted from the line along the way. At the end of the production line, thefinished goods are delivered to waiting output units.

6 IBM Directory Integrator 4.7: Getting Started Guide

Page 15: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

If a production crew gets the order to produce something else, they break downthe line, keeping the machines that are still relevant to the new order. New unitsare connected in the right places, the line is adjusted and production starts again.

The IBM Directory Integrator 4.7 AssemblyLines work in much the same way,except that at the end of the day, you don’t have to clean out the leftover fish bits.

The IBM Directory Integrator 4.7 AssemblyLines receive information from variousinput units, perform operations on this input and then convey the finished productthrough output units. Furthermore, IBM Directory Integrator 4.7 AssemblyLineswork on only a single item at a time -- i.e. one data record, directory entry, registrykey, and so forth.

Data from the connected input sources (for example, fields, attributes, values...) areaccumulated in a Java bucket (called the work object) and scripts are applied tothis information, verifying data content, computing new values and changingexisting ones, until it is ready for delivery from the line into one or more outputsources.

The input and output units of an IBM Directory Integrator 4.7 AssemblyLine arecalled Connectors, and each Connector is linked into a data source. Connectors tiethe dataflow to the outside world, and are also where data transformation andaggregation takes place. They are also where you can layer in your business,security and identity management logic.

ConnectorsConnectors are like puzzle pieces that click together while at the same time linkingto a specific data source, like an SQL database, message queue or a text file.

Each time you select one of these puzzle pieces and add it to an AssemblyLine,you first chose the type of Connector. Then you assign the Connector its role in thedata flow. This is called the Connector mode , and it tells IBM Directory Integrator4.7 how to use the Connector: either as an input unit iterating through, or lookingup information in its source -- or as an output Connector, inserting, updating ordeleting data in the connected system or device.

Chapter 1. Simplify and solve 7

Page 16: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Note: You might think that we’ve chosen to draw these puzzle pieces the wrongway: that data should be flowing in from above and then downwards to thereceiving data sources. But anyone who has ever tried to implement anintegration solution knows that data doesn’t tend to flow on its own. It mustbe sucked out of input sources and then pumped into the outputdestintions. And that’s what Connectors are good at.

You can change both the type and mode of a Connector whenever you want, andif you’ve planned for this eventuality, then the rest of the AssemblyLine might notneed to be changed at all. That’s why it’s important to treat each Connector as ablack box that either delivers data into the mix, or extracts some of it to send to adata source. The more independent each Connector is, the easier your solution is toaugment and maintain. Not to mention making it possible to swap data sourcesentirely!

By making your Connectors as autonomous as possible, you can also readilytransfer them to your Connector Library and reuse them to create new solutionsfaster -- even share them with others. Using IBM Directory Integrator 4.7’s libraryfeature also makes maintaining and enhancing your Connectors easier, since allyou have to do is update the Connector template in your library, and allAssemblyLines derived from this template inherit the enhancements. And whenyou are ready to put your solution to serious work, you can reconfigure yourlibrary Connectors to connect to the production data sources instead of those inyour test environment, and move your solution from lab to live in minutes.

Whenever you need to include new data to the flow, simply select the desiredConnector, set it to the relevant input or output mode and insert it into theAssemblyLine.

8 IBM Directory Integrator 4.7: Getting Started Guide

Page 17: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

IBM Directory Integrator 4.7 gives you a library of Connectors to choose from, likeLDAP, JDBC, Microsoft NT4 Domain, Lotus® Notes™ and JMS. And if you can’tfind the one you are looking for, you can extend an existing Connector byoverriding any or all of its functions using one of the leading scripting languages,including JavaScript, Visual Basic and Perl. You can even roll your own, either witha scripting language inside our Script Connector wrapper, or from scratch usingJava or C/C++. But be sure to check the Customer Pages of our website to makesure that someone else hasn’t already done this for you! Connectors are free todownload and trade.

Furthermore, IBM Directory Integrator 4.7 supports most transport protocols andmechanisms, like TCP/IP, HTTP and FTP -- with or without SSL, or otherencryption mechanisms to secure the information flow.

ParsersEven unstructured data, like text files or bytestreams coming over an IP port, ishandled quickly and simply with IBM Directory Integrator 4.7 by passing thebytestream through one or more Parsers. Parsers are another type of IBM DirectoryIntegrator 4.7 component. IBM Directory Integrator 4.7 is shipped with a variety ofParsers, including LDIF, DSML, XML, CSV and Fixed-length field. And just likeConnectors, you can extend and modify these, as well as create your own.

Continuing with our example from page5, tthe next step is to identify our datasources. Since our input data source is a text file in comma-separated value format,then we use the FileSystem Connector paired up with the CSV parser. We’ll use aFileSystem Connector for output as well, but this time we choose the XML parserin order to format our file as an XML document. The actual mechanics of doingthis in IBM Directory Integrator 4.7 are discussed in a minute. First, we’ll take alook at what our AssemblyLine looks like visually, using our puzzle pieces.

Chapter 1. Simplify and solve 9

Page 18: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Now that we’ve identified which components to use, we are ready to build thisAssemblyLine using IBM Directory Integrator 4.7. However, before you continue,you need an input file. You can either download this file from the Customer pagesof the website, or create it yourself in a text editor. The data looks like this:First;Last;TitleBill;Sanderman;Chief ScientistMick;Kamerun;CEOJill;Vox;CTORogerGregory;Highpeak;VP Product DevelopmentPeter;Belamy;Business Support Manager

Call this file People.csv and place it in the examples/Tutorial4 sub-directory ofyour IBM Directory Integrator 4.7 installation. Once it is in place, you are ready tobuild your solution using IBM Directory Integrator 4.7.

10 IBM Directory Integrator 4.7: Getting Started Guide

Page 19: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Note: The examples in this manual have been created on a Windows platform, andtherefore use the Windows pathname conventions. In order for your solutionto be platform independent, use the forward slash (/) instead of thebackslash character (\) in your pathnames, for example,examples/Tutorial/Tutorial1.cfg.

Chapter 1. Simplify and solve 11

Page 20: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

12 IBM Directory Integrator 4.7: Getting Started Guide

Page 21: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Chapter 2. Introducing IBM Directory Integrator 4.7

Rapid integration developmentIBM Directory Integrator 4.7 is actually two programs:

Admin Tool

This program gives you a graphical interface to create, test and debug yourintegration solutions. It’s what we call the TIDE (Transformation andIntegration Development Environment), and with it you create aconfiguration that is executed by the run-time engine. This executable iscalled MIADMIN.

Run-time Server

Using the configuration file you’ve created with the Admin Tool, theRun-time Server powers the integration solution. This program file iscalled MISERVER , and you can deploy your solution using as many or asfew server instances as you want. There are no limitations imposed by thetechnology or the IBM Directory Integrator 4.7 license agreement.

Both systems are written 100% in Java, and run in any environment that offers aJava 2 compliant Virtual Machine.

If you haven’t already started the Admin Tool, do so now. After a moment youshould be presented with the Main Screen. You might be asked if you wish tocreate a new configuration file called rs.cfg. Answer Yes and you are presentedwith the main screen.

Note: If the screen you see is different from the image above, your system mighthave a different display setting selected. You can change this with the menuselection View –>Look & Feel. Note also that the IBM Directory Integrator4.7 window is resizeable, so again, if the screenshots in this manual do notmatch your own experience, try changing the size of the window on yourscreen. The View–>Preferences selection opens a dialog where you can set anumber of other user interface parameters, like whether the button toolbar isvisible or not, or if you want IBM Directory Integrator 4.7 to use the StatusBar at the bottom of the window. If this does not help, check the versionnumber of IBM Directory Integrator 4.7, found by selecting Help–>Aboutfrom the Main Menu, and then reading the resulting dialog box.

© Copyright IBM Corp. 2002 13

Page 22: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

At the top of the screen is the Main Menu and the button toolbar.

The button toolbar provides commands for creating new configuration files, openexisting ones and saving your current work. These same commands are alsoavailable under the File menu, where you also find the Save As selection forsaving your configuration to a new filename.

Note: The path and filename of the current configuration file appear at all times inthe title bar of the IBM Directory Integrator 4.7 window.

Creating a new configuration fileIBM Directory Integrator 4.7 configurations are stored in files that are created andmaintained in the Admin Tool and run by the Server. Each configuration filecontains the AssemblyLines that a Server is to run, as well as the IBM DirectoryIntegrator 4.7 components that make up these lines. It also holds user preferenceslike colors and the GUI interface style.

14 IBM Directory Integrator 4.7: Getting Started Guide

Page 23: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Attention: Although it’s not within the scope of this text, configurations can alsobe spread over several files, and stored at several locations. IBM DirectoryIntegrator 4.7 assembles its configuration dynamically at startup, using includeURLs/filepaths that you have specified. This means that you can create andmaintain corporate settings and components that can be shared by many serverconfigurations.

When you start the system for the first time, IBM Directory Integrator 4.7 askswhether you want to create the default configuration file, called rs.cfg. Instead ofusing the default configuration file, we’re going to create a new one. Click NewConfiguration, or use the File–>New menu selection to create a configuration filecalled Tutorial1 (please note that the .cfg extension is added for you). This fileshould be located in the examples/Tutorial directory.

Note: Pathnames can be written as relative to the directory that you specifiedwhen installing IBM Directory Integrator 4.7.

Looking along the left side of the window, you can see a number of tabs. These arethe Configuration Tabs , and they give you access to your AssemblyLines andEventHandlers (which we’ll get into later). There are also tabs here for buildingand maintaining libraries of IBM Directory Integrator 4.7 components, as well asfor setting system and configuration properties. At the very bottom is the tabwhere you find the set of components that are installed with your system.

Note: The three lists under the Base Templates tab show you which componentsare currently installed. If you have just installed IBM Directory Integrator4.7, then these are the components that were bundled with this release.

Chapter 2. Introducing IBM Directory Integrator 4.7 15

Page 24: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Without going into the Admin Tool interface in great detail, we’ll go over thegeneral layout of these configuration screens:

First, each one shows you an Element List of selected configuration objects. Youselect an item by clicking on it, and in most cases you can open or edit it bydouble-clicking. You can also change the space allocated for any column in the listby moving the mouse cursor over the boundary between columns, and thenclicking and dragging the boundary to its new location.

At the top of each Element List is a row of buttons providing the set of operationsthat are available for that type of object. The list of available operations varies from

16 IBM Directory Integrator 4.7: Getting Started Guide

Page 25: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

screen to screen, but the general behavior is the same: You select an entry in thelist and then click the button (with the obvious exception of the Add button, whereyou do not need to select anything first).

Finally, you can select several elements at once by clicking on one and dragging upor down in the list while holding the mouse button down. This is particularlyhandy if you want to delete more than one element.

That’s enough for now. Let’s get started with creating our first integration solution.

Creating an AssemblyLineThe first thing we have to do is to create a new AssemblyLine. We do this by firstselecting the AssemblyLine Object Tab and then clicking Add. C this AssemblyLineCSVtoXML.

You can call an AssemblyLine whatever you want, but it is important to use anaming convention that helps to document your solution.

Attention: Use of special characters and spaces in naming AssemblyLines or IBMDirectory Integrator 4.7 components (like Connectors and EventHandlers) is notgood idea, as it might cause problems later when you want to start IBM DirectoryIntegrator 4.7 Server from a command prompt to run your solution.

IBM Directory Integrator 4.7 now takes you to the AssemblyLine screen. The firstthing you notice is that this new screen fills the entire window. But don’t panic,you can go back to the Configuration screen (or any other open object) by selectingone of the Context Tabs at the bottom of the screen.

Before we start adding our Connectors, let’s take a quick look at the layout of theAssemblyLine screen.

Chapter 2. Introducing IBM Directory Integrator 4.7 17

Page 26: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

At the top of the details screens associated with each of the Object Tabs (in thiscase, our new AssemblyLine Details display), you’ll find a colored title bar. Inaddition to the name of the currently selected object, this bar holds a button rowthat, at the very least, has a Close button for leaving this screen.

In the AssemblyLine Details screen we have the following buttons as well:

Run This button lets us execute the current AssemblyLine.

Run DebugIBM Directory Integrator 4.7 includes a data flow debugger which allows

18 IBM Directory Integrator 4.7: Getting Started Guide

Page 27: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

us to step through our AssemblyLine, watching the data being transportedand transformed inside the line, as well as our own script variables, ascontrol is passed from Connector to Connector.

View LogfileEach AssemblyLine gets its own set of logfiles, and we use this button toopen a display window for the most recent copy.

Close Closes this Object Details display.

The white box on the left side of the screen is the Connector List where newConnectors appear as we add them. To the right of the Connector List is a largegray area where the details of the currently selected Connector are displayed. Atthe top of this details area are the AssemblyLine Tabs. These give you access tovarious aspects of this data flow:

Prolog The Prolog tab lets you set up scripts to be evaluated/executed when theAssemblyLine starts up (and before control is passed to the firstConnector).

Data FlowWhere the Connectors are created and maintained.

Epilog The Epilog tab is for scripts that are to be run when the AssemblyLine iscomplete and is about to exit.

SettingsGives you a number of configuration parameters for this AssemblyLine.

If you click the Settings tab, you see that you can do things here like selecting thescripting language you want to use in this AssemblyLine8, as well as limiting thenumber of iterations (which is handy when developing and testing yourAssemblyLine on large data sets).

Note: Regardless of which scripting language you select to use in yourAssemblyLine, IBM Directory Integrator 4.7 still lets you use componentsthat have been scripted using other languages. So you can write yourAssemblyLine logic in JavaScript, but still use that Connector you createdwith VBScript, as well as your Perl-based Parser.

Chapter 2. Introducing IBM Directory Integrator 4.7 19

Page 28: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Just below the AssemblyLine tabs is the AssemblyLine button toolbar, offering youa number of AssemblyLine operations:

Going from left to right in this row, these buttons perform the following actions:

Add Adds a new Connector to the AssemblyLine;

Script Creates a data-source free Connector, called a Script Component , that canbe used to hold script logic for manipulating data in the AssemblyLine;

RemoveDeletes the currently selected Connector;

RenameAllows you to change the visual name of the current Connector;

Up Move the selected Connector up one spot towards the start of theAssemblyLine. This position is significant since the AssemblyLine calls theConnectors in order from top to bottom;

Down Takes the current Connector and pushes it down in the list of Connectors;

Copy to LibraryMakes a copy of the selected Connector and drops it into your ConnectorLibrary.

We’re going to make use of this button row in order to add our first Connector tothe AssemblyLine.

Adding the Input ConnectorClick Add to create the first Connector.

We’ll call it InputPeople and then choose the .FileSystem template from the list ofavailable Connectors. This is the same list that you saw when you selected the

20 IBM Directory Integrator 4.7: Getting Started Guide

Page 29: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Base Templates tab in the main Configuration screen back on See At the verybottom is the tab where you find the set of components that are installed withyour system., plus any Connectors that you have in your Connector Library whichshow up at the top of the drop-down.

The last parameter to set here is the Connector mode , and this tells theAssemblyLine how this Connector is to be used. IBM Directory Integrator 4.7 hassix Connector modes:

Note: Not all modes are available for all Connectors. For example, if you areworking with a flat file, then Lookup, Delete and Update are not supported(unless you write your own Connector, or enhance an existing connector).

AddOnlyThis mode is for Connectors that only add new information to the datasource, for example, writing to files, populating a database or directory forthe first time, and so forth.

Delete Delete mode causes the Connector to search for a specific record (orrecords) to delete.

IteratorA Connector in Iterator mode runs through the data source (or the desiredpart of it, like a view of a database, or the sub-tree of a directory) and thenreturn these data objects (records, entries, and so forth.) one at a time forprocessing in the AssemblyLine. Connectors in Iterator mode are calledIterators for short. An AssemblyLine can contain more than one Iterator,and these are executed in succession, the second Iterator starting up oncethe first one reaches the end of its data set.

LookupThis mode causes the Connector to find and return one (or more) records,and is the mode used to join information into a data flow.

PassivePassive mode tells the AssemblyLine that this Connector is not to beexecuted during normal operation. What’s the point then? Well, let’s saythat you want to log all error messages to a DB2 database. You would setup a JDBC Connector to point to this data source and put it in Passivemode. Then wherever you have error handling code (and we’ll take acloser look at this later) you can invoke your Passive-mode Connector towrite the error-log to the database.

UpdateIn Update mode, a Connector first tries to find the specified record (orrecords). If it succeeds, then existing entries are modified with theinformation you pass to the Connector. If the lookup fails, then theConnector adds the information instead.

There is no limit to the number of Connectors that an AssemblyLine can hold, andyou can also have as many of the same type as well -- even connected to the samedata source. In some cases, this is even necessary.

For example, if you want to create an AssemblyLine to delete all the records in adata source, you first need an Iterator (for example, a Connector in Iterator mode)which runs through the data set and return each entry, one and a time, forprocessing. These objects are passed on to your second Connector, which is of thesame type, but this time set to Delete mode. This AssemblyLine loops through theinput source and deletes each entry that it finds.

Chapter 2. Introducing IBM Directory Integrator 4.7 21

Page 30: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Sometimes it is undesirable to have multiple simultaneous connections to the samedata source (it can even be impossible due to resource locking or limits imposedby software licenses). In this case, you can tell IBM Directory Integrator 4.7 toreuse an existing connection when you set up a new Connector. This is done byscrolling all the way to the bottom of the Connector Type drop-down list. Here youfind the names of all the Connectors that appear in the AssemblyLine before thisone. These reusable Connectors appear in the list with an at symbol ( @ ) beforetheir names:

Returning to our example once more, as soon you have given your Connector itsname, type and mode (see “Adding the Input Connector” on page 20), click OK toconfirm your choices. This new Connector appears in the AssemblyLine ConnectorList at the left hand side of the window. Notice how the details for the currentlyselected Connector are now shown in the Details display area to the right of thelist.

22 IBM Directory Integrator 4.7: Getting Started Guide

Page 31: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

The first thing we have to do with any Connector that we add is configure it. Youdo this by click Configure... at the top area of the Connector details display.

Chapter 2. Introducing IBM Directory Integrator 4.7 23

Page 32: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

This brings up the Connector Configuration dialog. This dialog is closely tied tothe data source we are connecting to, and is different for each type of Connector.

The FileSystem Connector that we just added does not require any authenticationparameters. However, it does need the pathname of the file to use, the I/O modeand, since we are now working with unstructured data, a parser to pass thebytestream through in order to format it.

Select the People.csv file in the Tutorial directory, set the Connector to input modeand then choose the CSV parser.

Once the configuration parameters are in place, it’s time to check to see if we havea live connection to the data source by selecting the Attributes tab at the top of thisdialog.

From this tab we can click Connect at the bottom of the window and see if ourConnector can reach the data source. If all goes well, then the Next button isenabled. Each time we click Next, we are telling the system to read the next entryin the data source, analyze the schema and then convert the source-specific datatypes to their relevant Java objects, for example strings, date/time, integers and soforth.

24 IBM Directory Integrator 4.7: Getting Started Guide

Page 33: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

The data retrieved from the source is displayed in the grid, with the attributenames, the Java object types that IBM Directory Integrator 4.7 is converting themto and the actual values found in the data source. Not only do we confirm that weare live with the connected system or file, but we can also do a visual control ofthe data being read. And don’t panic if IBM Directory Integrator 4.7 is notconverting the underlying data types as you wish -- you can always override thisbehavior when you map these attributes into the data flow, as you’ll see in thenext section.

Mapping Attributes Into The AssemblyLineAttribute Mapping is the operation of moving information between the data sourceand our data flow. We just saw in the previous step how IBM Directory Integrator4.7 not only discovers the schema for us, it is also automatically converting thedata to Java objects. So why is Attribute Mapping necessary?

There are a couple of reasons. First off, although IBM Directory Integrator 4.7 hasmade the data available to you, the system has no preconceptions of how youintend to use it. So at the very least, you need to select which attributes you wantto use.

In addition, some of the attributes might have to be computed, combined orcreated, or converted to a different format or type than IBM Directory Integrator4.7 has chosen. All this is all typically handled through scripting in your AttributeMap.

Connectors are actually made up of two parts: the Raw Connector , which knowshow to talk to, and interpret responses, from a particular data source; and thegeneric Connector wrapper that allows Connectors to plug into and operate in theIBM Directory Integrator 4.7 AssemblyLine framework.

Information passed to (or from) a data source is kept in a temporary local storageobject inside the Raw Connector. It is from here that we map attributes into the

Chapter 2. Introducing IBM Directory Integrator 4.7 25

Page 34: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

AssemblyLine, or in the case of an output Connector, map them out to the datasource.

You can change the Raw Connector part of a Connector at any time by simplychanging its type. However, if you do, you probably also need to change theAttribute Map, since scripts in your AssemblyLine, as well as other Connectorsmight be impacted by the change. Particularly if the schema of the new datasource is different from that of the old one.

Your Attribute Map might also be affected if you change the mode of yourConnector, since Connectors in an input mode map attributes from local storage inthe Raw Connector (the script object called conn ) to the object used to store andtransport data in the AssemblyLine (the work object). Output Connectors mapattributes the other way: from work to conn.

If we return to our example again, cast your eyes at the lower left part of theConnector display window where you’ll find the Attribute Map list.

26 IBM Directory Integrator 4.7: Getting Started Guide

Page 35: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Below this list you find the following buttons:

New This button you add new attributes to the list. Although the Select buttonallows you to choose from a list of existing attributes, the New button letsyou add attributes by hand that might not be available (for example, theymight need to be computed, or perhaps optional attributes that theConnector did not discover in the source).

Select Click Select to open a dialog with a list of attributes to select from. For aninput Connector, this is the schema that IBM Directory Integrator 4.7discovered in the data source. In the case of an output Connector, this listcontains those attributes that are already in our data flow.

Delete Removes one or more attributes.

Click Select, and we’ll set up the Attribute Map for our Connector. You arepresented with the Select Connector Attributes dialog, displaying the list ofattributes that the system discovered when you clicked Connect and Next in theConnector Configuration dialog in the previous section. This dialog can be used atany time to add or remove attributes from the schema that IBM DirectoryIntegrator 4.7 has retrieved for you.

Chapter 2. Introducing IBM Directory Integrator 4.7 27

Page 36: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Once the window is up, you can either select the attributes that you wantindividually, or use the Select All button at the bottom of the dialog.

Click Select All to tag all the attributes for inclusion, and then OK to confirm yourchoice and close the dialog. Now the selected attributes appear in the AttributeMap part of the Connector Details display area.

28 IBM Directory Integrator 4.7: Getting Started Guide

Page 37: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

As you select attributes in this list, the details of how the mapping is performedare displayed off to the right. If you look to the top of these mapping details younotice two radio buttons: Advanced and Simple. As you can see, we are usingsimple mapping for our attributes, which means that IBM Directory Integrator 4.7is copying the values from the Raw Connector’s attributes with the same name.

However, if we want to convert the incoming data, or otherwise manipulate thesevalues, then we can script this ourselves in Advanced mode. Select Advancedmode and you’ll notice something interesting: even in Simple mode, IBM DirectoryIntegrator 4.7 has actually written a little code snippet for us.

Chapter 2. Introducing IBM Directory Integrator 4.7 29

Page 38: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

This line of script returns the attribute called First from local storage in the RawConnector (the conn object).

We’ll take a moment to look at the IBM Directory Integrator 4.7 script editorwindow, which appears wherever you need to write scripts. While in this window,you have a number of typical editor features (some of them appearing as buttonsin the row above the editor window).

Arrow keysMoves the cursor around in the editor window. If you hold the Shift keydown at the same time, then you select text. Pressing Ctrl and the left andright arrow keys moves the cursor around, one word at a time. And, ofcourse, you can combine Shift and Ctrl to select whole words or lines ofscript.

Cut Cuts the selection out of the text. This function is available as both the firstbutton in the row above the editor window, as well as through the Ctrl-Xkeyboard shortcut.

Copy Copies the current selection. Copy can be done by selecting the secondbutton in the button row, or pressing Ctrl-C.

Paste Pastes text (that you’ve copied or cut) into the script at the current positionof the cursor. You can either use the third button or press Ctrl-V.

Undo Rolls back the last editing operation. This is the fourth button.

Redo Reapplies the change that you just undid, Redo appears in the button rowjust after the Undo button

Find Allows you to search for text in your script. You can either click the sixthbutton (second from the right) or press Ctrl+F.

Find AgainRepeats the last search, appears at the right end of the button row, and hasits own keyboard shortcut: Ctrl+G.

30 IBM Directory Integrator 4.7: Getting Started Guide

Page 39: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Time to try our hand at scripting by adding an attribute called FullName whichwe’ll compute using values from other attributes read in from the input source. Soclick New at the bottom of the Attribute Map list.In the dialog box that appears, enter the name FullName and click OK.

IBM Directory Integrator 4.7 automatically tries to use simple mapping to retrievethe value from a data source attribute called FullName. This won’t work since thisinformation is not available in input file.

Instead, you need to select this new entry in the Attribute Map list and select theAdvanced mapping radio button. This gives us access to the script editor window.Here is the script that we use to create the value for this attribute:

This short script does the following for us:var gn = conn.getString("First");var sn = conn.getString("Last");

These first two lines get the string value of the First and Last attributes and storethem in local variables called gn and sn respectively.ret.value = gn + " " + sn;

Our last statement returns the value of these two local variables concatenatedtogether with a single space between them.

Note: We could have created this attribute in our output Connector. However,since we’re going to need it in our AssemblyLine later, we’ll put it here inthe input Connector.

The input feed to our data flow is now finished: we are connecting to our inputsource, passing the bytestream through the CSV parser one line at a time,converting these fields to Java objects and moving this data into the AssemblyLine.It’s time to add our output Connector.

Chapter 2. Introducing IBM Directory Integrator 4.7 31

Page 40: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Adding the Output ConnectorFrom the AssemblyLine Details screen, click Add again. This time we’ll name ourConnector XMLoutput , we’ll choose the FileSystem type once more, but this timeset the Connector to AddOnly mode since we are writing to a file.

As always, we have to configure this Connector using the Configure button (seepage 23). Call the output file Output.xml and write it to the same directory whereour input file was located. Then select Output mode and choose the .XML parser.

Once you are finished, you can click OK to close the Configure Connector dialog.

Once we are back in the AssemblyLine screen, our last step is to tell theXMLoutput Connector which of our AssemblyLine attributes we want to write toour XML document. To do this, we use the Select button at the bottom of theAttribute Map list.

IBM Directory Integrator 4.7 now gives you a warning dialog stating that you arenot selecting attributes from the data source itself. Instead, you are about to bepresented with a list over all the attributes that are currently available in our Javabucket (the work object) in our AssemblyLine.

32 IBM Directory Integrator 4.7: Getting Started Guide

Page 41: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Once you click Yes to acknowledge the warning, you get a familiar selection list.However, if you look at the title of this dialog, you’ll see that you are nowselecting from the Work Entry (our Java bucket). You can use the Select All buttonhere to choose all the attributes and then close the dialog.

All we have left to do now is to add the Mail attribute that we specified in ourdiagram on See In order to complete our visualization of the data flow, we’llrecord how the attributes of the input data source are mapped (and possiblymodified) to become those of the output source.. This is a computed field, and weconstruct this value on-the-fly (just as we did for FullName in the inputConnector). In addition, since people often have more than on email address, we’llmake this a multi-value attribute.

In order to do this, click New at the bottom of the Attribute Map list. This opens adialog asking you to name the new attribute. Call it Mail and click OK.

Now select the Advanced Attribute Mapping radio button and enter the followingscript.

Let’s walk through this script:var gn = work.getString("First");var sn = work.getString("Last");

These first two lines store the values of the First and Last attributes in localvariables. Notice how we are using the work object to access data inside theAssemblyLine.var att = system.newAttribute("tempname");

Chapter 2. Introducing IBM Directory Integrator 4.7 33

Page 42: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

This next line uses a system call to create a new attribute. We have to give it atemporary name, although this is not transferred when we return the value at theend of the script.att.addValue(gn + "@company.com");att.addValue(gn + "." + sn + "@company.com");

These two lines compute and add two values to this attribute, making it amulti-value attribute.ret.value = att;

Finally, we return the newly created attribute. The IBM Directory Integrator 4.7framework deals with this for us, converting the complex object to the format ofthe output source. At last we are ready to watch our first data flowimplementation in action.

Running your AssemblyLineYour AssemblyLine is now complete and ready to test. To do this, click Run in theObject button toolbar at the top of the AssemblyLine Details area.

Note: Before you run your AssemblyLine, you might want to go toView–>Preferences and check the box entitled reuse command window.This tells IBM Directory Integrator 4.7 not to open a new window each timeyour run your AssemblyLine.

When you tell IBM Directory Integrator 4.7 to run an AssemblyLine, the systemstarts up an instance of the server and then pipes the current configuration to it.

Note: You can start up the server from outside the Admin Tool and instruct itwhich configuration file to use.

IBM Directory Integrator 4.7 also creates a monitor window that the server writesits status output to.

34 IBM Directory Integrator 4.7: Getting Started Guide

Page 43: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Not counting the Process exit code line at the bottom that simply tells us that theserver stopped after executing the specified AssemblyLine, the output in thiswindow is divided into four main parts:1. Information about the version of the server that you are running.2. Description of the environment that IBM Directory Integrator 4.7 is running in,

including which VM it is configured to use, and the working directory.3. License information.4. The last area the monitor outputs is usually the biggest, and tells you a number

of things:v Which parameters were used to start the serverv The configuration file that is being used; and finallyv Messages generated during the execution of the AssemblyLine and its

Connectors

You can send messages to this screen as well, using special IBM DirectoryIntegrator 4.7 objects and functions available when writing your scripts.

Chapter 2. Introducing IBM Directory Integrator 4.7 35

Page 44: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

At the bottom of this last section is the message that our AssemblyLine (CSVtoXML ) ran without errors. That means that we should be able to open theoutput file that we specified previously (see “Adding the Output Connector” onpage 32).

Opening this file (for example, in a browser) enables you to confirm that theAssemblyLine has actually converted the CSV input data to the XML document.

36 IBM Directory Integrator 4.7: Getting Started Guide

Page 45: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

We can see that our input data was correctly read in from the CSV file, and thenpassed to our output Connector which wrote it to the XML document. Even ourMail attribute is there, computed on-the-fly for us by our script.

Chapter 2. Introducing IBM Directory Integrator 4.7 37

Page 46: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

However, one of the entries (″Roger″) appears to be incomplete. This entry islacking both the Last and Title attributes. If we check our input data file (listed onSee First;Last;Title) then we can see that these fields are actually missing from ourinput CSV file.

The easiest solution would be to edit the CSV file and add the missing fields;However, few data sources give us this much control. So instead, we are going totry filtering our input by scripting a Hook.

Attention: Before we start evolving our AssemblyLine, let’s save our work firstby either clicking Save in the main tool bar, by selecting File–>Save from the MainMenu, or by pressing Ctrl+S. Each time you save your configuration file, the lastsave time value is updated in the title bar.

Working with HooksHooks are waypoints in a Connector’s work cycle where you can add logic to beexecuted each time IBM Directory Integrator 4.7 reaches that point, for example,before a Delete, or after an Add operation. The hooked script runs until completionbefore the Connector continues its work.

There are a number of Hooks that are common to all Connectors, plus a few thatare mode-specific. In order to work with the Hooks of the InputPeople Connector,first select it in the Connector List and then click Hooks tab (right next to AttributeMap ).

38 IBM Directory Integrator 4.7: Getting Started Guide

Page 47: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

There are three sets of Hooks for every Connector, represented by folders in theHooks tree-list:

In PrologThese scripts are fired up when the AssemblyLine first starts, meaning theyare run only once.

DataFlowHere is where you’ll find the Hooks that are executed at every iteration ofthe AssemblyLine, each time this Connector is run. In the above example,since the InputPeople Connector is in Iterator mode then this means that itis doing a number of GetNext operations to retrieve the input data. As aresult, IBM Directory Integrator 4.7 gives us Hooks like Before GetNextand After GetNext so that we can wrap this read operation in our ownlogic.

After EpilogHooks are executed once at the end of the AssemblyLine’s life-cycle.

So, with the InputPeople Connector selected, click After GetNext Hook in the list.Now enter the following script in the edit window to the right of the Hooks list:

Chapter 2. Introducing IBM Directory Integrator 4.7 39

Page 48: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Stepping through the script, let’s see what our filtering code is doing:var sn = conn.getString("Last");var title = conn.getString("Title");

These first two lines are retrieving the values (as strings) of two attributes that areavailable in the Raw Connector (the conn object).if (sn == null){

Then we check to see if the value returned for the Last attribute is null, meaningthat it does not exist in the input data source. If this is the case, then the next threelines are executed.

Note: We want to test for the existence of more fields in the production version ofour AssemblyLine.

task.logmsg("--> Record skipped (missing data)");

The task object gives us access to AssemblyLine functions, like logmsg() which letsus write to the AssemblyLine’s logfile.task.dumpEntry(conn);

This time we use the AssemblyLine’s dumpEntry() function to write the contentsof the Raw Connector’s local storage object ( conn ) to the logfile. Note that thisfunction works equally well for output Connectors, except that we would bepassing it the work object instead.system.skipEntry();}

Finally, we use the system object to signal to IBM Directory Integrator 4.7 that wewant to skip this input entry, and start back at the top of the AssemblyLine loopand read the next one.

Before we test our line again, we’re going to make a slight change to the outputAttribute Map.

40 IBM Directory Integrator 4.7: Getting Started Guide

Page 49: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Schema conversionIn our example, the output attributes happened to have the same names as thosein the input source. But let’s imagine for a moment that our specification hadcalled for the output attributes to be called FirstName and LastName.

IBM Directory Integrator 4.7 makes mapping schemas easy, and all we need to dois update the names of these attributes directly in the Attribute Map of our outputConnector.

So, select the XMLoutput Connector, select the attribute that you want to changeand start typing.

Chapter 2. Introducing IBM Directory Integrator 4.7 41

Page 50: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

And don’t worry about this affecting scripts in your AssemblyLine, since we areonly changing these names locally for the Attribute Mapping phase of the outputConnector; The First and Last attributes are still being read in correctly, and areavailable inside the AssemblyLine.

Note: Because IBM Directory Integrator 4.7 keeps focus in the field that you areentering, even if you switch to a different Connector or AssemblyLine, youmight need to press Enter (or otherwise shift focus to another Attribute) sothat IBM Directory Integrator 4.7 knows that you are finished with yourchanges before you try running the AssemblyLine again.

We’ll leave these changes in (even though it’s not actually part of our originalspecification) and then run our AssemblyLine again. When IBM DirectoryIntegrator 4.7 completes, go back to the output browser window and hit the refreshbutton If you closed that window, you’ll have to repeat the steps you used to openthe output file after the first run.

Once our output file is visible again, we can confirm that ″Roger″ is no longerthere (he used to be between ″Jill″ and ″Gregory″). Furthermore, we can see thechanges that we made to the names of two of our attributes:

42 IBM Directory Integrator 4.7: Getting Started Guide

Page 51: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

We’ll save our work again (Ctrl+S), and then go to the next step: Aggregating datafrom a third data source.

Chapter 2. Introducing IBM Directory Integrator 4.7 43

Page 52: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Adding the Join ConnectorIncluded with the Tutorial files is a simple database of people who owe us money(important information, this!). We’ll use this source to do get information about ourdebtors into the output source.

Our first step is to add a third Connector by clicking Add in the AssemblyLinetool bar. Call this one Debtors and choose the .BTreeObjectDB Connector type. ThisConnector needs to be in Lookup mode since we are searching for records thatmatch the data inside our AssemblyLine.

We were working with the XMLoutput Connector last, so when we add one to thelist, IBM Directory Integrator 4.7 drops our new Connector right after the onecurrently selected. But this won’t work, because we need to do the aggregationbetween the input and output Connectors.

To fix this, click Up in the AssemblyLine tool bar.

This moves our Connector up one slot so that it is executed after InputPeople, butbefore XMLoutput. Once again we click Configure... to set up this Connector.

Enter the pathname of the data file, which might be different from the one above,depending on where you installed IBM Directory Integrator 4.7 (note that thedatabase file itself is called Debtors.dat ). In the Key Attribute Name field youneed to specify the name of the attribute that differentiates these records. In ourtutorial database this is the FullName attribute (which should give you a hint as towhy we constructed a similarly named attribute in our input Connector).

To test our Connector, we select the Attributes tab, click Connect and then Next.You should now be able to see the data in this source.

44 IBM Directory Integrator 4.7: Getting Started Guide

Page 53: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Again, IBM Directory Integrator 4.7 is reading the schema and converting the dataaccordingly to Java objects. You can close this dialog now.

Now we set up the Attribute Map by clicking Select under the Attribute Map list,and then pick only Amount and DateOfLoan from the list presented. That’s all weneed, plus we already have an attribute named FullName so we don’t need toaggregate this data into our AssemblyLine.

Note: As you’ll see in the following section, we are about to use this data source’sFullName field to set up our Link Criteria. However, an attribute does doesnot need to be included in our Attribute Map in order for us to use it aspart of a Link Criteria.

Setting up Link CriteriaBecause it’s in Lookup mode, our new Debtors Connector is searching for specificentries in its data source, trying to find a match for the entry that is already insidethe AssemblyLine. Exactly how this match is made is specified by us in what iscalled the Connector’s Link Criteria.

If you take a look at the AssemblyLine screen (still in the DataFlow tab for ourAssemblyLine), you see that because our Connector is in Lookup mode, we’ve gota new tab next to Attribute Map and Hooks.

Selecting this tab brings up the Link Criteria display where we can specify howthis Connector is to do its lookup.

Chapter 2. Introducing IBM Directory Integrator 4.7 45

Page 54: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Now, do you recall how we looked at IBM Directory Integrator 4.7’s feature forscripting an Attribute Map directly ourselves? The same applies here, so bychecking the Advanced Link Mode checkbox (just under the Link Criteria tabitself) we get an Editor window where we can write the data source specificlookup call ourselves. This could be an SQL SELECT statement for a JDBCConnector, or an LDAP search call if we where connected to directory.

However, just as with Attribute Mapping, IBM Directory Integrator 4.7 can handlethe details of this for us automatically, creating the relevant command for theunderlying data source, and keeping our solution a bit more data sourceindependent.

We’ll use this feature and simply click Add at the bottom of the screen (shown inthe screenshot above).

When the Link Criteria dialog box appears, we first choose an attribute from theschema that IBM Directory Integrator 4.7 discovered in the data source. Then weselect a comparison operation (like equals or contains ). The last field lets usspecify the attribute inside our AssemblyLine to be compared to.

46 IBM Directory Integrator 4.7: Getting Started Guide

Page 55: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

For example, we’ll choose the FullName attribute from our Debtors data source,the equals operation, and then the FullName 16 attribute that we scripted in ourinput Connector. Click OK when you’re done.

Note: You probably noticed the dollar sign ($) in front of the FullName attributein the AssemblyLine. This special character enables IBM Directory Integrator4.7 to retrieve the first value of this attribute (it might have any number ofvalues) to use in building the Link Criteria. If we wanted to match any oneof the values of a multi-value attribute, we would use the at symbol (@)instead.

Once the dialog is closed and you are back in the AssemblyLine screen, select theXMLoutput Connector so that we can update its Attribute Map to include the datathat we’re aggregating into the line. Do this by once again clicking Select underthe Attribute Map list, clicking past the warning again, and then choosing the newAmount and DateOfLoan attributes.

Chapter 2. Introducing IBM Directory Integrator 4.7 47

Page 56: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

You might be wondering why the First and Last attributes no longer appear to beselected. That’s because when IBM Directory Integrator 4.7 builds this list, itcompares the current Attribute Map with the list of available attributes to seewhat’s already been included. Since we’ve changed the names of the First and Lastattributes for our output map, IBM Directory Integrator 4.7 can’t find them in ourAttribute Map anymore, and un-checks them in the selection dialog. If you were toclick on them, then these attributes would be added to the mapping list with theiroriginal names again.

Now you can close this dialog box, save your work and run the AssemblyLineagain. Our XML document should now look like this:

48 IBM Directory Integrator 4.7: Getting Started Guide

Page 57: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Note: The order in which the attributes for each entry appear is not relevant, andmight not be the same on your system as it appears in the screenshots ofthis manual.

Chapter 2. Introducing IBM Directory Integrator 4.7 49

Page 58: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

We can see a couple of important changes here: First, we can see the two newDebtors fields that we included in the output. Secondly, and possibly a bit of asurprise, we notice that our XML file now includes only three entries.

That’s because these are the only entries in our input source ( InputPeople ) thatIBM Directory Integrator 4.7 managed to match with data in our aggregationsource ( Debtors ). When our Lookup Connector did not find matchinginformation in the database, it faulted to the AssemblyLine error handler whichthen skipped this entry -- like when we used the system.skipEntry() function inour input filter script.

If this is not what we want, then all we have to do is enable the On Error Hook ofour Debtors Connector.

Instead of sending the Lookup Failed error to the AssemblyLine error handler, IBMDirectory Integrator 4.7 detects that we have error handling code of our own anduses it instead. Of course, we probably want to do something a bit more intelligentthan just enabling an empty script Hook.

In addition, remember how we filtered out ″Roger″ during our initial input? Thiscould cause a situation where the person or people filtered during input actuallyowed us money, but our AssemblyLine never gets that far with these records.

As an alternative, we could have created default values for missing attributes inour first Connector. IBM Directory Integrator 4.7 gives you a number of ways tohandle missing values.

However, this won’t help much in our case, since we want real values for bothFirst and Last in order to create a FullName attribute which we later need in theDebtors Link Criteria. Hmmm. Back to the drawing board.

50 IBM Directory Integrator 4.7: Getting Started Guide

Page 59: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Final thoughtsAs you can see, although IBM Directory Integrator 4.7 makes building our dataflows fast and easy, the quality of the resulting solution is dependent on how goodour specification is. But IBM Directory Integrator 4.7 actually helps us here as wellby removing the platform and vendor technology blinders that block our visionand limit our imagination.

And when you approach an integration problem at the data flow level, you reducecomplexity. This gives you gains across the board: in deployment speed, accuracyof the solution, robustness, maintainability . . . the list goes on. In fact, as you startto think in terms of simplify and solve mantra, you see your installation, and itsintegration possibilities, from a whole new perspective.

IBM Directory Integrator 4.7 keeps making a difference long after your solution isfinished and deployed. Because your business and technical requirements change,IBM Directory Integrator 4.7 lets you enhance and grow your solution to meetthese new challenges. That’s the beauty of IBM Directory Integrator4.7–incremental implementation. It means that you can grow your integrationsolution (and your infrastructure) to fit your needs, as well as the environmentwhere it’s going to live.

Perception is reality, and our perception is formed–and limited–by the toolset weuse. The choice is simple: You can continue to accept reality as you perceive it,whittling away at the vision of your integration infrastructure in order to make itfit the tools you are using. Or you can switch tools. But be warned, it might behard to switch back.

Chapter 2. Introducing IBM Directory Integrator 4.7 51

Page 60: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

52 IBM Directory Integrator 4.7: Getting Started Guide

Page 61: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Appendix. Notices

This information was developed for products and services offered in the U.S.A.IBM might not offer the products, services, or features discussed in this documentin other countries. Consult your local IBM representative for information on theproducts and services currently available in your area. Any reference to an IBMproduct, program, or service is not intended to state or imply that only that IBMproduct, program, or service may be used. Any functionally equivalent product,program, or service that does not infringe any IBM intellectual property right maybe used instead. However, it is the user’s responsibility to evaluate and verify theoperation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matter inthis document. The furnishing of this document does not give you any license tothese patents. You can send license inquiries, in writing, to:

IBM Director of LicensingIBM CorporationNorth Castle DriveArmonk, NY 10504-1785U.S.A.

For license inquiries regarding double-byte (DBCS) information, contact the IBMIntellectual Property Department in your country or send inquiries, in writing, to:

IBM World Trade Asia Corporation Licensing2-31 Roppongi 3-chome, Minato-kuTokyo 106, Japan

The following paragraph does not apply to the United Kingdom or any othercountry where such provisions are inconsistent with local law:INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THISPUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHEREXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESSFOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express orimplied warranties in certain transactions, therefore, this statement may not applyto you.

This information could include technical inaccuracies or typographical errors.Changes are periodically made to the information herein; these changes will beincorporated in new editions of the information. IBM may make improvementsand/or changes in the product(s) and/or the program(s) described in thisinformation at any time without notice.

Any references in this information to non-IBM Web sites are provided forconvenience only and do not in any manner serve as an endorsement of those Websites. The materials at those Web sites are not part of the materials for this IBMproduct and use of those Web sites is at your own risk.

IBM may use or distribute any of the information you supply in any way itbelieves appropriate without incurring any obligation to you.

© Copyright IBM Corp. 2002 53

Page 62: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Licensees of this program who wish to have information about it for the purposeof enabling: (i) the exchange of information between independently createdprograms and other programs (including this one) and (ii) the mutual use of theinformation which has been exchanged, should contact:

IBM CorporationDepartment LZKS11400 Burnet RoadAustin, TX 78758U.S.A.

Such information may be available, subject to appropriate terms and conditions,including in some cases, payment of a fee.

The licensed program described in this document and all licensed materialavailable for it are provided by IBM under terms of the IBM Customer Agreement,IBM International Program License Agreement, or any equivalent agreementbetween us.

Any performance data contained herein was determined in a controlledenvironment. Therefore, the results obtained in other operating environments mayvary significantly. Some measurements may have been made on development-levelsystems and there is no guarantee that these measurements will be the same ongenerally available systems. Furthermore, some measurement may have beenestimated through extrapolation. Actual results may vary. Users of this documentshould verify the applicable data for their specific environment.

Information concerning non-IBM products was obtained from the suppliers ofthose products, their published announcements or other publicly available sources.IBM has not tested those products and cannot confirm the accuracy ofperformance, compatibility or any other claims related to non-IBM products.Questions on the capabilities of non-IBM products should be addressed to thesuppliers of those products.

All statements regarding IBM’s future direction or intent are subject to change orwithdrawal without notice, and represent goals and objectives only.

All IBM prices shown are IBM’s suggested retail prices, are current and are subjectto change without notice. Dealer prices may vary.

TrademarksThe following terms are trademarks of International Business MachinesCorporation in the United States, or other countries, or both:

IBM DB2 Lotus Notes SecureWay

Java and all Java-based trademarks and logos are trademarks or registeredtrademarks of Sun Microsystems, Inc. in the United States and other countries.

Windows is a registered trademark of Microsoft® Corporation.

UNIX is a registered trademark of The Open Group in the United States and othercountries.

54 IBM Directory Integrator 4.7: Getting Started Guide

Page 63: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

Other company, product, and service names may be trademarks or service marksof others.

Appendix. Notices 55

Page 64: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

56 IBM Directory Integrator 4.7: Getting Started Guide

Page 65: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple
Page 66: IBM Directory Integrator 4.7: Getting Started Guidepublib.boulder.ibm.com/.../en_US/PDF/gettingStarted.pdfLet’s start our first IBM Directory Integrator 4.7 tutorial by doing a simple

����

Printed in U.S.A.