August 15, 2023

Scenario: Generating random java data – Docs for ESB 6.x

Scenario: Generating random java data

The following scenario creates a two-component Job, generating 50 rows structured as
follows: a randomly picked-up ID in a 1-to-3 range, a random ascii First Name and Last
Name generation and a random date taken in a defined range.

Use_Case_tRowGenerator1.png
  • Drop a tRowGenerator and a tLogRow component from the Palette to the design workspace.

  • Right-click tRowGenerator and select
    Row > Main. Drag this main row link onto the tLogRow component and release when the plug symbol
    displays.

  • Double click tRowGenerator to open the
    Editor.

  • Define the fields to be generated.

Use_Case_tRowGenerator2.png
  • The random ID column is of integer type, the First and Last names are of
    string type and the Date is of date type.

  • In the Function list, select the relevant
    function or set on the three dots for custom function.

  • On the Function parameters tab, define the
    Values to be randomly picked up.

Use_Case_tRowGenerator3.png
  • First_Name and Last_Name columns are
    to be generated using the getAsciiRandomString function that is predefined in
    the system routines. By default the length defined is 6 characters long. You can
    change this if need be.

  • The Date column calls the predefined getRandomDate
    function. You can edit the parameter values in the Function parameters tab.

  • Set the Number of Rows to be generated to
    50.

  • Click OK to validate the setting.

  • Double click tLogRow to view the Basic
    settings. The default setting is retained for this Job.

  • Press F6 to run the Job.

Use_Case_tRowGenerator4.png

The 50 rows are generated following the setting defined in the tRowGenerator editor and the output is displayed in the Run console.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x