Configuring the service operation - 6.4

Talend Data Services Platform Getting Started Guide

author
Talend Documentation Team
EnrichVersion
6.4
EnrichProdName
Talend Data Services Platform
task
Design and Development
Installation and Upgrade
In this section, the service operation is customized to match the scenario.

Procedure

  1. On the workspace, double-click tMysqlInput to open its Basic settings view in the Component tab.
  2. Configure the tMysqlInput to load the customer data in a MySQL database. In the DB version field, select the version of your MySQL database. It is Mysql 5 in this example. Specify the connection details in the relevant fields, including:
    • the host name or IP address of your database server
    • the listening port number
    • the database name
    • the user name and password for your database authentication
  3. Set the Schema as Built-In and click Edit schema to define the desired schema. The schema editor opens. Click the [+] button to add three rows of String type and give the name id, Phone, Email to the columns. Click OK to close the schema editor.
  4. In the Table Name field, type in the name of the database table, customers in this case.
  5. In the Query box, enter the query required to retrieve the desired columns from the table, id, Phone, Email in this example.
  6. On the workspace, double-click tXMLMap to open its editor. At this moment, the editor should look like:
  7. In the main row table of the input flow side (left), right-click the column name payload and from the contextual menu, select Import from Repository. Then the Metadata wizard is opened.
  8. Expand the File XML node in this wizard, select the schema of the request side and click OK to validate this selection. In this example, the schema is CustomerServiceOperationRequest.
  9. In the main row table of the output flow side (right), right-click the column name payload and from the contextual menu, select Import from Repository. In the Metadata wizard, select the schema CustomerServiceOperationResponse to import the hierarchical schema for the response.
  10. To create the join to the lookup data, click the id node in the main row of the input side (left), hold and drop it onto the Exp.key column of the lookup flow, corresponding to the id row.
  11. On the table representing the lookup flow, click the wrench icon on the up-right corner to open the settings panel. Set Lookup Model as Reload at each row, Match Model as All matches and Join Model as Inner join.
  12. On the output table (right), click the wrench icon on the up-right corner to open the settings panel and set the All in one option as true. Right-click the Email node and select As loop element in the context menu.
  13. Click the Phone row in the lookup flow (left), hold and drop it onto the Expression column corresponding to the Phone node in the XML tree view of the output flow. Do the same to map Email from the left side to the right side.

    The tXMLMap editor should look like this:

  14. Click OK to close the editor and validate this configuration.

Results

Now, the implementation of the CustomerServiceOperation is complete.