August 17, 2023

tExtractEDIField – Docs for ESB 5.x

tExtractEDIField

tExtractEDIField_icon32_white.png

tExtractEDIField properties

Component family

Processing / EDIFACT

 

Function

tExtractEDIField reads an input
United Nations/Electronic Data Interchange For Administration,
Commerce and Transport (UN/EDIFACT) message file, generates an XML
according to the EDIFACT family and the EDIFACT type, and extracts
data by parsing the generated XML using the XPath queries manually
defined or coming from the [Repository] wizard.

Purpose

tExtractEDIField opens an input
EDIFACT message file, reads the EDI structured data directly without
having to write it out to a temporary file first, extracts data
through XPATH queries, and finally sends the data to the next
component via a Row
connection.

Basic settings

Property type

Either Built-in or Repository.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

 

 

Built-in: No property data is
stored centrally.

 

 

Repository: Select the repository
file where properties are stored. The fields that follow are
completed automatically using the fetched data.

 

Schema and Edit
Schema

A schema is a row description, it defines the number of fields to
be processed and passed on to the next component. The schema is
either Built-in or stored remotely
in the Repository.

Click Edit schema to make changes to the schema. If the
current schema is of the Repository type, three options are
available:

  • View schema: choose this option to view the
    schema only.

  • Change to built-in property: choose this option
    to change the schema to Built-in for local
    changes.

  • Update repository connection: choose this option to change
    the schema stored in the repository and decide whether to propagate the changes to
    all the Jobs upon completion. If you just want to propagate the changes to the
    current Job, you can select No upon completion and
    choose this schema metadata again in the [Repository
    Content]
    window.

 

 

Built-in: You create the schema
and store it locally for this component only. Related topic: see
Talend Studio User
Guide
.

 

 

Repository: The schema already
exists and is stored in the Repository, hence can be reused in
various projects and Job flowcharts. Related topic: see
Talend Studio User
Guide
.

 

EDI filename

Filepath to the UN/EDIFACT message file to be processed.

 

EDI version

UN/EDIFACT version of the input file.

 

EDI type

UN/EDIFACT standard of the input file.

 

Ignore new line

Select this check box to skip carriage returns in the input
file.

 

Loop query

Node of the structure tree on which the loop is based.

 

Mapping

Column: Reflects the schema as
defined by the Schema type field.

XPath Query: Enter the fields to be
extracted from the structured input. These fields are editable when
the property type of the component is Built-In.

Get nodes: Select this check box to
recuperate the content of all current nodes specified in the
Xpath query list or select the
check box next to specific nodes to recuperate only the content of
the selected nodes. This operation is available when property type
of the component is Built-In.

 

Die on error

Select this check box to stop Job execution when an error is
encountered. By default, this check box is cleared, and therefore
illegal rows are skipped and the process is completed for the error
free rows.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a
Job level as well as at each component level.

Global Variables

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio
User Guide.

Usage

This component is usually linked to an output component to gather
the processing result.

Limitation

n/a

 

Scenario: Extracting data from an EDIFACT message

This scenario describes a simple Job that reads the EDIFACT structure of an input
UN/EDIFACT Customs Cargo (CUSCAR) message file, and extracts data according to the
schema definition. The extract data is displayed on the Run console and sent to an XML file.

Use_Case_tExtractEDIField1.png
  • Drop the following components from the Palette onto the design workspace: tExtractEDIField, tLogrow, and
    tFileOutputXML.

  • Connect the components using Row >
    Main connections.

  • Double-click tExtractEDIField to display its
    Basic settings view and define its
    properties.

Use_Case_tExtractEDIField2.png

Note

In this use case, the input schema is stored in the Metadata node of the Repository
tree view for easy retrieval. For further information concerning metadata, see
Talend Studio User Guide.

  • Select Repository from the Property Type list, and then click the three-dot
    button next to the field that appears to open the [Repository Content] dialog box.

  • In the [Repository Content] dialog box,
    select the desired metadata item, cuscar in this use case,
    and click OK.

  • In the EDI parameters area, fill the
    EDI filename field with the full path to
    the input EDIFACT message file.

    In this use case, the input file is
    99a_cuscar.edi.

  • Select the Ignore new line check box to skip
    the carriage return characters in the input file during data processing.

  • As all the other parameters are automatically retrieved, simply leave them as
    they are.

  • Double-click the tFileOutputXML component to
    show its the Basic settings view.

Use_Case_tExtractEDIField3.png
  • Fill the File Name field with the full path
    to the output XML file you want to generate.

    In this use case, the output XML is
    99a_cuscar_extract.xml.

  • Leave the other parameters as they are.

  • Save your Job and press F6 to run it.

    The defined data in the input EDIFACT CUSCAR message file is retrieved,
    displayed on the console, and written into the output XML file.

Use_Case_tExtractEDIField5.png

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x