How to write a Job script - 6.4

Talend Data Management Platform Studio User Guide

EnrichVersion
6.4
EnrichProdName
Talend Data Management Platform
task
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

In the API Editor of the Talend Studio, you can use the auto-completion (Ctrl+Space) to help you write your Job script. Functions, parameters and some values will be suggested to you.

The code will display in color to easily differentiate the code, the values and the comment. And the syntax is checked for any mistake. If a parameter is wrongly set a red cross displays. Moreover, you can use template to write your Job script. For more information on the color definition of the text or on how to manage Job script templates, see Job script preferences (JobScript).

A Job script is mainly made as following:

  • First, the components of your process.

  • Second, the connections between those components.

  • Other information like context parameters, other parameters and notes.

Component properties

Component properties can be divided into three main parts:

  • component definition

  • component schema

  • specific settings

To add a component, type in the addComponent{} function and define its properties between the brackets:

Function

Parameter

Value

setComponentDefinition{}

TYPE

Type in the component you want to use, for example: tRowGenerator.

 

NAME

Type in the name you want to give to the component, for example: tRowGenerator_1.

 

POSITION (optional)

Type in the position of the component in the design workspace, for example: 2,3.

Note

The position of the component must be indicated in brackets.

setSettings{}

 

Define the component settings. This parameter is specific to each component.

addSchema{}

NAME

Give a name to schema.

 

CONNECTOR

Type in the connection type of the schema, for example: FLOW, REJECT, etc.

 

addColumn{}

Add as many columns as your schema needs and define the column parameters:

NAME: Type in the label of the column.

TYPE: Type in the type of data contained in this column.

KEY: Define the column as primary key by typing in the value of true.

NULLABLE: Define the column as nullable by typing in the value of true.

Note

All parameters have to be separated with a comma.

Connection properties

To add a connection, type in the addConnection{} function and define its properties between the brackets:

Parameter

Value

TYPE

Type in the type of connection used in the component, for example: FLOW, REJECT, etc.

NAME

Give a name to the connection.

LINESTYLE

Define the style of the row.

For example, 0 refers to a row main, 8 refers to a row lookup.

SOURCE

Type in the name of the source component.

TARGET

Type in the name of the target component.

Note

All parameters have to be separated with a comma.