TalendDataGenerator Routines - 6.5

Talend Open Studio for MDM User Guide

EnrichVersion
6.5
EnrichProdName
Talend Open Studio for MDM
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

The TalendDataGenerator routines are functions which allow you to generate sets of test data. They are based on fictitious lists of first names, second names, addresses, towns and States provided by Talend. These routines are generally used when developing Jobs, using a tRowGenerator, for example, to avoid using production or company data.

To access the routines, double click on TalendDataGenerator under the system folder:

Routine

Description

Syntax

getFirstName

returns a first name taken randomly from a fictitious list.

TalendDataGenerator.getFirstName()

getLastName

returns a random surname from a fictitious list.

TalendDataGenerator.getLastName()

getUsStreet

returns an address taken randomly from a list of common American street names.

TalendDataGenerator.getUsStreet()

getUsCity

returns the name of a town taken randomly from a list of American towns.

TalendDataGenerator.getUsCity()

getUsState

returns the name of a State taken randomly from a list of American States.

TalendDataGenerator.getUsState()

getUsStateId

returns an ID randomly taken from a list of IDs attributed to American States.

TalendDataGenerator.getUsStateId()

Note

No entry parameter is required as Talend provides the list of fictitious data.

You can customize the fictitious data by modifying the TalendGeneratorRoutines. For further information on how to customize routines, see Customizing the system routines.

How to generate fictitious data

It is easy to use the different functions to generate data randomly. Using a tJava component, you can, for example, create a list of fictitious client data using functions such as getFirstName, getLastName, getUSCity:

System.out.println(TalendDataGenerator.getFirstName()); 
System.out.println(TalendDataGenerator.getLastName()); 
System.out.println(TalendDataGenerator.getUsCity()); 
System.out.println(TalendDataGenerator.getUsState());
System.out.println(TalendDataGenerator.getUsStateId());
System.out.println(TalendDataGenerator.getUsStreet());

The set of data taken randomly from the list of fictitious data is displayed in the Run view: