Data translations can be shared
Several mappings can share data translations. For example, if you use the example data translators above in two mappings or two mapping versions the specified translation data is used by both mappings or mapping versions. You specify translation data in ION Desk for ION or in the Partner Administration tool for a EC mapping.
In the given example, the data translations are unique for the EDIFACT D01B ORDERS
message.
If you create another mapping for invoice using the given example pattern there will be other unique data translations defined, for example, the EDIFACT D01B INVOIC
message.
While sharing data translations is a good practise, for example in translating qualifiers, you should use generic data translations. For example, code lists such as language code, currency code, and others. For this purpose, create another global MECDataTranslator
variable.
Follow these guidelines:
-
Use Variable to specify the variable name
dtGen
, or any suitable name. -
Instead of a specific message type, message version, message type document, or parent path, specify the hard coded strings
Generic
. -
Use Value path to specify the value to identify the data to translate, for example,
LanguageCode
orCurrencyCode
.Note: Conditional path and value are not used for generic data translations and can be empty strings ("").
Now that you have defined these two global MECDataTranslator
variables, you can use any of these in the whole mapping when performing data translations:
-
Use
dt
for message specific data translations. -
Use
dtGen
for generic translations.
Example of the Java function "initiate"
This is a Java function initiate in an inbound EDI mapping using both message specific data translation (dt) and generic data translation (dtGen):
String logicalId = "Generic";
String tenantId = null;
String accountingEntityId = null;
String locationId = null;
dt = new MECDataTranslator(MyMapping, logicalId, tenantId, accountingEntityId, locationId, "EDIFACT", "D96A", "ORDERS", 'I');
dtGen = new MECDataTranslator(MyMapping, logicalId, tenantId, accountingEntityId, locationId, "Generic", "Generic", "Generic", 'I');
Example of a generic data translation
This is a generic data translation of a language code mapped from the input message to the input parameter iLanguageCode
. The translated value is assigned to the output parameter oLanguageCode
that, for example, can be mapped to the root element attribute languageCode
for a BOD.
oLanguageCode = dtGen.translate("Generic", "LanguageCode", iLanguageCode, "", "", "Language Code");