|
|
ConnectorsConnectors are used to access and update information sources in a variety of formats and protocols. There are basically two types of connectors. The first is where both transport and content is known to the connector using a well known API (like ODBC, LDAP). The second type is where the transport mechanism is known but not the content. The latter requires a Parser to interpret or generate the content in order to function properly. A list of all Connectors included with the Metamerge Integrator is included here. But you can also write your own Connector, see an example here. Connectors operate in the following modes: Iterator, Lookup, AddOnly, Update, Delete and Passive. Each Connector mode determines a specific Connector's behavior. Note however, that it is not necessary that every Connector support all of the modes available. When you use a Connector you should first consult its manual for the modes supported. How do Connectors share data?Connectors not in Iterator mode have their data passed through the work object. If no work object exist because you have no Iterator, the non-iterator Connectors will not be called. You can create your own Working Entry in the Prolog by:
Note that an initial work Entry in the Prolog can be regarded as fed from an invisible one pass Iterator. See Multiple Iterators in an AssemblyLine below for side effect this causes. Iterator modeConnectors in Iterator mode are used to scan a data source and extract its data. The Iterator Connector actually iterates through the data source entries, reads their attributes' values and delivers each Entry to the AssemblyLine and its non-Iterator connectors. Note that it does not matter exactly what the data source is (database, LDAP directory, XML document, etc.) and how its data is actually stored. Each Connector presents an abstract layer over the particular data source and you will access and process data through instances of the Entry and Attribute classes. In fact, each AssemblyLine (except those called with an initial Working Entry, see How do Connectors share data above) should contain at least one Connector in Iterator mode. Iterators (if we call the Connectors in Iterator mode this way) supply the AssemblyLine with data. If an AssemblyLine has no Iterator it will be useless because its Connectors will be passed nothing to process. Iterators are always regarded as being first in the AssemblyLine: They are executed before other non-iterator Connectors, regardless of their place in the AssemblyLine. Multiple Iterators in an AssemblyLineIf you have more than one Connector in Iterator mode, these Connectors are stacked in the order in which they appear in the configuration and processed one at the time. An initial work Entry is treated as coming from an invisible Iterator processed before any other Iterators. Assume you have an AssemblyLine with two Iterators, a preceding b. a is first used (the AssemblyLine ignoring b) until it returns no more entries. Then the AssemblyLine switches to b (ignoring a). An initial work Entry is treated like it came from an invisible Iterator before a and b: It would be processed (the AssemblyLine ignoring both a and b), before the AssemblyLine will start calling a. If you do not want an initial work Entry to be used in the AssemblyLine (because it contains the wrong Attributes, and has been used for instance in the Prolog), you could call task.setWork(null) in the Prolog to remove the initial work Entry, thus causing the first Iterator to be used to get the first work Entry. Using the Iterator modeThe most common pattern for using a Connector in Iterator mode should be: 1. Add a Connector in Iterator mode to
your AssemblyLine. Lookup modeConnectors in Lookup mode are used to retrieve particular Entry's attributes from a data source by other (most often key) Entry's attributes (already retrieved from another data source or set by the Administrator). Lookup Connectors give the possibility to join data from different data sources using the relations among the entities from these data sources. The main action in setting up and using a Lookup Connector is the configuration of its Link Criteria. It is always configured through the MI Admin user interface - each Lookup Connector has an associated Link Criteria tab. The tab defines the rule for finding relevant entries. The Link Criteria rule itself is either a conjunction of simple conditions required for certain Entry's attributes or a more general Connector specific mini script. Note that the Link Criteria may identify more than one Entry (these Entries are called Duplicates). Lookup Connectors have an option that allows/disallows Duplicates. You can control this option from the "Allow Duplicates" check-box available. o If "Allow Duplicates" is turned
off (default state) and
Duplicates appear then: Example package with ready to run MI configuration that handles Duplicates is included here. Using the Lookup modeThe most common pattern for using a Connector in Lookup mode should be: 1. Add a Connector in Lookup mode to
your AssemblyLine. AddOnly modeConnectors in AddOnly mode are used for adding new data in a data source. This Connector mode requires almost no configuration - just point out the attributes of the Entry and the data source parameters. The AddOnly Connector receives Entries (most often from an Iterator) and writes them in its data source. Using the AddOnly modeThe most common and simple pattern for using a Connector in AddOnly mode should be: 1. Add a Connector in AddOnly mode to
your AssemblyLine. Update modeConnectors in Update mode are used for adding and modifying data in a data source. For each Entry passed from the AssemblyLine, the Update Connector tries to locate an Entry from the data source to modify with the Entry's attributes values received. The rule for finding the Entry for modification is configured in the Link Criteria section in the same format as in the Lookup mode. If no such Entry is found, a new Entry is added to the data source. If one such Entry is found, it is modified. If more than one entry matches the Link Criteria, the "Multiple Entries Found" Hook is called. Furthermore, each attribute can be tuned whether to be modified or added, when respectively Modify or Add operation is performed. When doing a Modify operation, only those attributes that are marked as Modify, are changed in the data source. If the Entry passed from the AssemblyLine does not have a value for one attribute, the Null Value Behavior for that attribute becomes significant. If it is set to "Delete", the attribute will not exist in the modifying entry, thus the attribute will not be changed in the data source. If it is set to "NULL", the attribute will exist in the modifying entry, but with a null value, which means that the attribute will be deleted in the data source. An important feature that Update Connectors offer is the "Compute Changes" option. When turned on, the Connector first checks the new values against the old ones and updates only if and where needed. Thus you can skip unnecessary updates which can be really valuable if the update operation is a heavy one for the particular data source you are updating. Using the Update modeThe most common and simple pattern for using a Connector in Update mode should be: 1. Add a Connector in Update mode to
your AssemblyLine. Delete modeConnectors in Delete mode are used for deleting data from a data source. For each Entry passed from the AssemblyLine, the Delete Connector tries to locate an Entry from the data source. If one Entry is found, it is deleted, otherwise nothing happens. The rules for finding the Entry for deletion is configured in the Link Criteria section in the same format as in the Lookup mode. Using the Delete modeThe most common and simple pattern for using a Connector in Delete mode should be: 1. Add a Connector in Delete mode to
your AssemblyLine. Passive modeConnectors in Passive mode are not passed Entries during the AssemblyLine execution. They are configured by the Administrator and initialized by the AssemblyLine, but never used in the standard AssemblyLine's execution process. They can be invoked by script code from any of the control points for scripting provided by Metamerge Integrator (see Scripting concept). Using the Passive modeThe most common and simple pattern for using a Connector in Passive mode should be:
The instructions above assume that you only want to use the Raw Connector and Parser components of the Passive mode Connector. If you also want to use the Attribute Mapping and Hooks that the Connector provides, you can do the following instead
ExampleDemo package containing ready to run configurations that demonstrate each of the above Connector modes through the JDBC Connector is included here.
|
|
|