Configuring the components - 7.0

Data Integration Job Examples

author
Talend Documentation Team
EnrichVersion
7.0
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Design and Development > Designing Jobs
EnrichPlatform
Talend Studio

Procedure

  1. Double-click the tSetGlobalVar component to display its Basic settings view in the Component tab.
  2. Click the [+] button to add a line in the Variables table:
    • In the Key field, type in jsonEncoded

    • In the Value fields, type in:

      MetaServlet.base64Encode("{\"actionName\":\"runTask\",\"taskId\":\"" + context.task_id + "\",\"mode\"
      :\"synchronous\",\"context\":{\"Default\":\"" + ((String)globalMap.get("tMsgBox_1_RESULT")) + "\"},
      \"authPass\":\"" + context.tac_pwd + "\",\"authUser\":\"" + context.tac_user + "\"}") 

      to call the routine you have previously created.

  3. Then double-click the tREST component to display its Basic settings view.
  4. Fill the URL field with the URL of the Web service you are going to invoke. For this use case, type in:
    context.tac_url + "/metaServlet?" +((String)globalMap.get("jsonEncoded"))

    to call the service and encode the MetaServlet parameters in a Json format.

  5. From the HTTP Method list, select GET to send an HTTP request for generating a task.
    In this way, the MetaSerlet is invoked via the REST API of Talend Administration Center with the relevant parameters.
  6. In the Basic settings view of the tLogRow component, select the Basic option to display the result in the Run console.
  7. Save your Job and press F6 to launch it.

Results

The console shows that the tREST component sends an HTTP request to the server end to run the specified task, and that the task has been executed without errors.

In the Job Conductor page of Talend Administration Center, the status of the task is now ready to run.