Scenario 2: Updating user information to a remote database from within a process using Talend ESB REST Client connector

Talend Connectors for BPM Reference Guide

Talend Data Services Platform
Talend Real-Time Big Data Platform
Talend Data Fabric
Talend ESB
Design and Development
Talend Studio

This scenario explains how to configure the Talend ESB REST Client connector to update a record of user information to a remote database using the HTTP POST method.


  • In the Integration perspective of your Talend Studio, you have created a Job as described in the scenario on how to implement a REST service accepting HTTP POST requests in the Talend Components Reference Guide.

  • The above-mentioned Job is running as a REST server to expose a REST service that accepts HTTP POST requests, and you can see the following service definition information when entering http://localhost:8045/users?_wadl in your Web browser:

Creating a new process and adding variables for the input data (Step one)

  1. Create a new process, rename the process pool to Update User Info, and select the Step1 element in the process model.

  2. From the General view of the Details panel, select the Data tab and click the Add... button to create an input variable.

  3. Name the variable id, clear the Auto-generate form check box because we will create a form manually to show the input variables. If needed, you can specify the default value in the Default value field. When done, click Finish.

  4. Repeat the steps above to create two other input variables named first_name and last_name, with the Auto-generate form check box cleared.

  5. From the Application view, click the Entry Pageflow tab and click the Add... button next to the first table.

  6. Select the Create a new form option and click Next.

  7. On the next step, configure which variables will be shown on the form. Select the id, first_name and last_name check boxes and click Finish. A newly created form displays the selected variables. Edit the form so that the variables are displayed in the way you want.

Adding and configuring the Talend ESB REST Client connector

  1. From the General view, select the Connectors tab and click the Add... button. A window opens.

  2. Select Talend > Talend ESB REST Client then click Next to open the connector configuration wizard.

  3. Give the connector a name, UpdateUserInfo for example, and click Next.

    The REST Service configuration page opens.

  4. Configure the REST Service.

    • Fill the Endpoint URL field with the URL of the REST Service implement by the Job mentioned above, http://localhost:8045/users in this example.

    • Fill in the Relative Path field with /post/${id}/${first_name}/${last_name}. This allows you to enter the information you want to update to the server end via the resource path when the process is executed.

    • From the Method list, select POST, to update the specified information to the remote server through the called REST service.

    • From the Accept Type list, select ANY, to transform any type of response message into a string.

    • Expand the Request node, select XML from the Content Type list, and fill the Request field with the request payload structure:

    • Leave all the other parameters as they are.

  5. Click Next. The Configure TESB Feature page opens to let you configure service locator information, service activity monitoring, and business correlation. As we do not use any of these options in this example, simply click Next to proceed with connector output mapping.

  6. Click the Create data button to open the [Add a new variable] dialog box.

    Name the variable userInfo, clear the Auto-generate form check box, then click Finish to close the dialog box.

  7. Remove the correlation ID output mapping if you want, which is not required in this example, and click Finish to close connector configuration wizard.

Configuring response display

  1. Add a new task (Step 2) and an end event to the process model.

  2. Click the Step2 icon in the process model, then click the tools icon on the bottom-left corner.

  3. Select the Human icon. The task type is changed to Human.

  4. From the General view for this new human task, select the Actors tab and click the Choose... button.

  5. Select Initiator and click Finish to close the window.

  6. From the Application view, click the Entry Pageflow tab, click the Add... button next to the first table, and select the Create a new form option and click Next to create a form for this step.

  7. In the [Create a new Form] dialog box, select the userInfo variable and click Finish. A newly created form displays the userInfo variable. Edit the form as needed.

Running the process and updating user information to the server

  1. Click the Run process button on the toolbar to run the process. The Update User Info page opens in your default browser.

  2. Click the Submit button to call the REST service. Enter the user ID, first name, and last name in the corresponding fields, and click Submit to be updated the information to the server end.

    The HTTP POST operation is performed and the response message corresponding to the information you just entered is displayed in the User Info field.

  3. Switch to the Integration perspective and check the Run console of the Job running as the REST server. The server end information shows that the HTTP POST request sent from process has been successfully handled and the user information has been updated to the database.