Translator

Use the Translator activity to translate a file from one format to another format.

See TIBCO Foresight® Translator Using Translator PDF document for more information about the translation function.

Examples

Refer to the associated examples: EDI Plug-in Example Processes.

Translated Data Formats

Translation for the following data formats is supported by this activity.

From (Source) To (Target)
EDI XML
XML EDI
EDI Flat File
Flat File EDI
Flat File XML
XML Flat File
EDI EDI
Flat File Flat File

General

The General tab contains the following fields.

Field Literal Value/Module Property/Process Property? Description
Name No The name to be displayed as the label for the activity in the process.
Operation Type No This drop-down list allows you to specify the operation type. Refer to the Translated Data Formats section above.
Input Mode No Specifies where the input data is stored. There are two options: File and Memory. Memory is normally the most efficient way of connecting, but large documents should be stored as files.
Output Mode No Specifies where the output data is stored. There are two options: File and Memory. Memory is normally the most efficient way of connecting, but large documents should be stored as files.
CallBack Buffer Size Select a number.
CallBack No Select this checkbox to use a Java Class for callback (optional).
Note: This function is not available for XML input.

See to Translator CallBack for more complete information on Enabling Callbacks.

Class Name No Specify a Java Class. This field is enabled when CallBack is checked.

Create a new Java Class.

Browse to an existing Java Class using the Type selection dialog.

See to Translator CallBack for more complete information on Enabling Callbacks.

Description

The Description tab is used to provide a short description for the activity.

Input

The Input tab contains the following fields.

Field Datatype Description
input string Specifies the full path and name of the input file.
map_filename string This field specifies the name and extension of a map file. The EDI Plug-in supports map files with the .map and .xml file name extensions.

A map file specifies the source and target guidelines for each translation map. The source guideline describes the data before translation. The target guideline describes the data after translation.

Note: All involved XSD, STD, and MAP files must be in the TIBCO_FORESIGHT_HOME /Translator/Database directory. If you want to share guidelines with the TIBCO_FORESIGHT_HOME /Instream/Database directory, refer to the Share Guidelines and Maps (Translator) section below.
output_directory string Specifies the full path and name of the directory for the output files.
input encoding string (Optional) The input encoding used for translation. This is used when translating to ISO-8859-1 only. Valid values are blank (no encoding) or ISO-8859-1.
output encoding string (Optional) The output encoding used for translation. Valid values are blank (no encoding), UTF-8, UTF-16, or ISO-8859-1.
separater_group string Specifies that translator should overwrite the target EDI delimiters using this string of four characters (in this order):

seg/elm/comp/repeat

For example, entering

!*:^

will cause the target EDI to use the '!' character as the segment terminator, the '*' character as the element delimiter, the ':' character as the composite sub-element delimiter, and the '^' character as the repeating element delimiter.

Share Guidelines and Maps (Translator)

If you install Translator and Instream in different directories, you can share their Database directories by modifying the TIBCO_FORESIGHT_HOME /Instream/bin/$dir.ini or TIBCO_FORESIGHT_HOME /Translator/bin/$dir.ini file.

For example, if you want to use the TIBCO_FORESIGHT_HOME /Instream/Database directory as shared, perform the following steps:
  1. Open the TIBCO_FORESIGHT_HOME /Translator/bin/$dir.ini file.
  2. Modify the database path and point it to the TIBCO_FORESIGHT_HOME /Instream/Database directory.
    The following is an example:
    :* FORESIGHT Supplied .STD Standard Files
    FSFACTORY ="C:\Foresight\Instream\Static"
    
    :*User-defined .STD Standard Files
    ALLUSERSSHARED ="C:\Foresight\Instream\Database"
    Note: The value must be enclosed with double quotation marks.
  3. After making the modification, you can put the involved XSD, STD, and MAP files either in the TIBCO_FORESIGHT_HOME /Translator/Database directory or in the TIBCO_FORESIGHT_HOME /Instream/Database directory.

Output

The Output tab contains the following fields.

Output Item Datatype Description
output_msg string The output of this activity is the translated message in the specified format, which can be the EDI, XML, or Flat File format.

The generated message format is specified in the Operation Type field on the Configuration tab.

return_code integer Specifies the Translator return code.

For example, 100 means the transaction ran successfully, 158 means the map file cannot be opened, and so on.

Translator return codes are listed in the TIBCO Foresight® Translator Using Translator PDF document.

encoding string The encoding used for translation.

Fault

The Fault tab lists exceptions that are thrown by this activity.

Error Schema Element Datatype Description
msg string Error message description.
msgCode string The error code. It represents TIBCO ActiveMatrix BusinessWorks Plug-in for EDI and TIBCO Foresight errors.

See Error Codes for details.