The table below lists some useful MDM routines including those for mangling Foreign Keys. In MDM, you usually need to mangle foreign keys to accommodate to compound keys.
To access these routines, double-click MDM in the system folder in the Integration perspective. The MDM category contains several routines including getFK and createFK:
Routine |
Description |
Syntax |
---|---|---|
getFK |
Returns one of the FK components by position in a mangled FK. |
|
createFK |
Returns the FK string by a single key (String singleKey). |
|
createFK |
Returns the Fk string by a key list (String[] keys). |
|
getRepeatingElement |
Gets repeating element in xmlString according to the xpath & position. |
|
hasRepeatingElement |
Checks repeating elements in xmlString according to xpath & text; |
|
listRepeatingElement |
Lists repeating elements in xmlString according to xpath & delimiter. |
|
addRepeatingElement |
Adds repeating elements in xmlString according to xpath & text. |
|
createReturnMessage |
Generates an <error code="X">msg</error> fragment. |
|
setLanguageVariant |
Adds or updates an ISO variant to the multilingual text value. |
For example:
which will update the EN variant to be "abc". The output message will be [EN:abc][FR:ab_fr]. |
setLanguageVariant |
Adds or updates an ISO variant to the multilingual text value with the default ISO and the sort option for the output message. If the sort option is set to "true", the message will be output in alphabetical order. |
For example:
|
getLanguageVariant |
Gets an ISO value from a multilingual text value with the default ISO fallback. If the ISO value requested is not found, the default ISO value will be returned. |
For example:
|
getLanguageVariant |
Gets an ISO value from a multilingual text value. If the ISO value requested is not found, the null value will be returned. |
For example:
|
getNodeList |
Gets a nodelist from an xPath. |
|
parse |
Parses the XML. |
|
nodeToString |
Generates an XML string from a node with or without the XML declaration. |
|
For more information about the examples of the setLanguageVariant and getLanguageVariant routines, see How to handle ISO variants or get an ISO value from a multilingual text.
The getFK routine allows you to return one component of a mangled foreign key using tMap, for example:
![]() |
You must use the getFK MDM routine in the lookup table in the Map Editor. Using the getFK routine in the editor, you can add/remove/update the foreign key components. In the above capture, the routine helps you to return the name component in the mangled foreign key.
You must do the same in a reversed case and use the createFK routine to return the foreign key string by a single key.
The setLanguageVariant routine allows you to add, update or remove ISO variants in a multilingual text value, while the getLanguageVariant routine allows you to get the value of an ISO variant from a multilingual text value.
To better illustrate how to use the setLanguageVariant and getLanguageVariant routines, this section describes some routine examples with different parameter settings. Note that the examples are not exhaustive.
For more information about those routines, see MDM Routines.
The following table lists the examples which set different parameters for the routines and explains what the result will be.
Example |
Description |
---|---|
|
The setLanguageVariant routine
may contain three parameters. In this case, the first parameter
indicates an ISO variant, and the second parameter indicates its
value. The last parameter shows the original multilingual text or
the value of the default ISO variant. Note that the default ISO
variant is If the ISO variant does not appear in the original multilingual text, the ISO variant and its value will be added to the text. Otherwise, the old value of the ISO variant will be updated with the new one, without modifying the other ISO variants. After this routine example is called, the output message will be
|
|
Because the ISO variant After this routine example is called, the output message will be
|
|
If you leave second parameter empty, the ISO variant will be removed. After this routine example is called, the output message will be
|
|
The setLanguageVariant routine may contain five parameters. In this case, the first parameter indicates an ISO variant, and the second parameter indicates its value. The third parameter indicates the original multilingual text or the value of the default ISO variant. The fourth parameter is the default ISO variant. The last parameter indicates whether the message will be sorted and output in alphabetical order. If the ISO variant does not appear in the original multilingual text, the ISO variant and its value will be added to the text. Otherwise, the old value of the ISO variant will be updated with the new one, without modifying the other ISO variants. After this routine example is called, the output message will be
|
|
Because the ISO variant After this routine example is called, the output message will be
|
|
Because the ISO variant After this routine example is called, the output message will be
|
|
The getLanguageVariant routine may contain two parameters. In this case, the first parameter indicates the ISO variant whose value will be fetched. The second parameter shows the multilingual text. If the specified ISO variant does not appear in the multilingual
text, the The return value for this routine example is |
|
Because the ISO variant |
|
The getLanguageVariant routine may contain three parameters. In this case, the first parameter indicates the ISO variant whose value will be fetched. The second parameter indicates the default ISO variant. The last parameter shows the multilingual text. If the specified ISO variant does not appear in the multilingual text, the value of the default ISO variant will be returned. The return value for this routine example is
|