Skip to main content Skip to complementary content

tMDMRestInput Standard properties

These properties are used to configure tMDMRestInput running in the Standard Job framework.

The Standard tMDMRestInput component belongs to the Talend MDM family.

This component is available in Talend MDM Platform and in Talend Data Fabric.

Basic settings

Schema and Edit Schema

A schema is a row description, it defines the number of fields that will be processed and passed on to the next component. The schema is either built-in or remote 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: The schema will be created and stored for this component only.

 

Repository: The schema already exists and is stored in the repository. You can reuse it in various projects and jobs.

Use an existing connection

Select this check box if you want to use a configured tMDMConnection component.

URL

Enter the URL to access the Talend MDM Server through the REST API.

Username and Password

Enter the user authentication data for the Talend MDM Server.

To enter the password, click the [...] button next to the password field, enter the password in double quotes in the pop-up dialog box, and click OK to save the settings.

Data Container

Enter the name of the data container that holds the data records you want to read.

Type

Select Master or Staging to specify the type of database on which the reading action should be performed.

Retrieve raw data

Select this check box to retrieve all the queried data into a single field if needed.

  • XML field: Select the name of the single field in which you want to write the retrieved data.

  • Accept Type: Select the type of content (XML or JSON) you want to get.

Query Text

Enter the query text you want to include in REST API calls to retrieve the data records of interest. Note that this is mandatory.

Apart from the default sample query, the query text can be:

  • a globalMap variable, for example, ((String)globalMap.get("row1.query"))

  • a pre-escaped context variable, for example, context.lpcMDMRestQuery

  • a query including the globalMap variable and/or the context variable, for example, "{'select':{'from':['"+context.myEntity +"'],'fields':[{'field':'"+ (String)globalMap.get("field") +"'}] }}"

You can provide each JSON field of your query text between either single or double quotes.

Any single quote included in the value of a field in the query text must be double escaped with backslashes.

For example, if you have the value This is Product's name for the field Name of a Product entity, to filter this particular value, you can write the query text in either of the following ways:

  • "{'select':{'from':['Product'],'where':{'eq':[{'field':'Product/Name'},{'value':'This is Product\\'s name'}]}}}"
  • "{\"select\":{\"from\":[\"Product\"],\"where\":{\"eq\":[{\"field\":\"Product/Name\"},{\"value\":\"This is Product\\'s name\"}]}}}"

Once you have entered the query text, make sure to set the schema correctly based on the query text. For more information, see How to set the schema correctly based on the query text when using tMDMRestInput.

Information noteWarning: You need to select the Retrieve Raw Data check box only if you want to parse the queried raw data in XML or JSON format by yourself.
Information noteNote: Using this component, when retrieving data from an entity involving a repeating foreign key element, you must add a join clause between the main entity and the linked entity in your select query.

For example, considering an entity named Product which contains a collection of foreign keys pointing to another entity named Store, when retrieving data of the repeating foreign key element named StoreFK, you would write:

{
   'select':{
        'from':['Product'],
        'fields':[
             {'field':'Product/Id'},
             {'field':'Product/StoreFK'}
         ] 
    }
}

Instead you have to write:

{
   'select':{
        'from':['Product'],
        'fields':[
             {'field':'Product/Id'},
             {'field':'Product/StoreFK'}
         ] ,
         'joins': [
             {
             'from': 'Product/StoreFK',
             'on': 'Store/Id'
             }
          ] 
    }
}

For more information about the select query with a join clause, see the section Join to other types in the article MDM query language and REST data access.

Die on error

Select this check box to skip the row in error and complete the process for error-free rows. If needed, you can retrieve the rows in error via a Row > Rejects link.

Advanced settings

Batch Size

Number of lines in each processed batch.

When the number of records for the current query is greater than the batch size, the records should be paginated and retrieved batch by batch.

tStatCatcher Statistics

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

Global Variables

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.

NB_LINE: the number of rows processed. This is an After variable and it returns an integer.

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 more information about variables, see Using contexts and variables.

Usage

Usage rule

tMDMRestInput can be used along with tMDMConnection, tMDMCommit, and tMDMRollback.

tMDMRestInput needs an output link.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!