Metamerge logo
Search

Advanced Search
*
*
*
* HOME DOCUMENTS & RESOURCES DOWNLOADS EARLY TECH ACCESS SUPPORT FAQ KNOWN ISSUES OLD VERSIONS
*

 

Link Criteria

The Link Criteria is used to let Update, Lookup and Delete Connectors know what record to access in the external data-source. The Link Criteria is accessible in the admin tool through a tab that you will find in Update, Lookup and Delete Connectors.

There are to variants of Link Criteria: Simple and Advanced.  Note that usually the Connector will go to the On Error Hook if more than one record match the link criteria.

Simple Link Criteria

In the simplest case it links a value from the AssemblyLine with a value from the Data-source.  To be more precise it  links the value of an attribute in the work entry to a value of an attribute in the raw Connector.

As an example, imagine we have a work entry with an attribute called  Name.  We want from a database the row of table Student where column ID is equal to work.Name.

Using Simple Link Criteria (default), the syntax would be 

Connector Attribute Operand Value
ID equal  $Name

As you will see from the Link Criteria tab, dropdowns for these three columns are provided (For the Connector Attribute column you must have previously done a Connect/Query Schema in the Configure/Attribute window in order to get dropdown values).

A Connector can have many link criteria: They are added by using the Add button. If you have several link criteria, there is an implicit AND operator between them.

Note that in the example above, the Value was set to $Name . The possible formats for Value are

  • A text string - mapped to a constant with that value
  • $Name - corresponds to  work.getString("Name"), that is the (first) value of the attribute Name.
  • @Name - meaning 'one of the values of the multivalued attribute Name

Advanced Link Criteria

Sometime, the Simple Link Criteria is not enough, because multiple link criteria are always ANDed.

If you select the Advanced Link Mode checkbox, you are able to script your link criteria.

You will have to populate a text string called ret.filter that will provide the Link Criteria or filter.  However, you will have to know the syntax used by the underlying Raw Connector: An LDAP and an SQL Connector will have different syntax.

A simple JavaScript example for a SQL Connector would be
 ret.filter = " ID LIKE '" + work.getString("Name") + "'"; 

The example assumes an example where the Raw Connector has an attribute called ID (typically a column name) and that we want to match it with work.name.

Note:

  • The first part of the SQL expression, Select * from Table Where , is provided by the Integrator
  • Single quotes have been added since work.getString() returns a string, while SQL Syntax asks for single quotes around strings constants.
  • The special syntax with $ and @ is not used here
 

 

*
  Metamerge Integrator version 4.6 ©Copyright Metamerge AS 2000-2002 Last edited 2002-06-10 contact us