tBufferOutput - 6.3

Talend Open Studio Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Function

This component collects data in a buffer in order to access it later via webservice for example.

Purpose

This component allows a Webservice to access data. Indeed it had been designed to be exported as Webservice in order to access data on the web application server directly. For more information, see Talend Studio User Guide.

tBufferOutput properties

Component family

Misc

 

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.

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

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.

In the case of the tBufferOutput, the column position is more important than the column label as this will be taken into account.

 

 

Built-in: The schema will be created and stored 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 designs. Related topic: see Talend Studio User Guide.

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 not startable (green background) and it requires an output component.

Scenario 1: Buffering data

This scenario describes an intentionally basic Job that bufferizes data in a child job while a parent Job simply displays the bufferized data onto the standard output console. For an example of how to use tBufferOutput to access output data directly on the Web application server, see Scenario 2: Buffering output data on the webapp server.

  • Create two Jobs: a first Job (BufferFatherJob) runs the second Job and displays its content onto the Run console. The second Job (BufferChildJob) stores the defined data into a buffer memory.

  • On the first Job, drop the following components: tRunJob and tLogRow from the Palette to the design workspace.

  • On the second Job, drop the following components: tFileInputDelimited and tBufferOutput the same way.

Let's set the parameters of the second Job first:

  • Select the tFileInputDelimited and on the Basic Settings tab of the Component view, set the access parameters to the input file.

  • In File Name, browse to the delimited file whose data are to be bufferized.

  • Define the Row and Field separators, as well as the Header.

  • Describe the Schema of the data to be passed on to the tBufferOutput component.

  • Select the tBufferOutput component and set the parameters on the Basic Settings tab of the Component view.

  • Generally the schema is propagated from the input component and automatically fed into the tBufferOutput schema. But you could also set part of the schema to be bufferized if you want to.

  • Now on the other Job (BufferFatherJob) Design, define the parameters of the tRunJob component.

  • Edit the Schema if relevant and select the column to be displayed. The schema can be identical to the bufferized schema or different.

  • You could also define context parameters to be used for this particular execution. To keep it simple, the default context with no particular setting is used for this use case.

Press F6 to execute the parent Job. The tRunJob looks after executing the child Job and returns the data onto the standard console:

Scenario 2: Buffering output data on the webapp server

This scenario describes a Job that is called as a Webservice and stores the output data in a buffer directly on the server of the Web application. This scenario creates first a Webservice oriented Job with context variables, and next exports the Job as a Webservice.

Creating a Job

  1. Drop the following components from the Palette onto the design workspace: tFixedFlowInput and tBufferOutput.

  2. Connect tFixedFlowInput to tBufferOutput using a Row Main link.

Creating a context variable

For this scenario, you will define two context variables: nb_lines and lastname. The first variable will set the number of lines the tFixedFlowInput component will generate, and the second one will set the last name to display in the output list. For more information about how to create and use context variables, see Talend Studio User Guide.

To define the two context variables:

  1. Select the Contexts tab view of your Job, and click the [+] button at the bottom of the view to add two variables, respectively nb_lines of type Integer and lastname of type String.

  2. In the Value field for the variables, set the last name to be displayed and the number of lines to be generated, respectively Ford and 3 in this example.