Calling the routine in a Job - 6.4

Standard

author
Talend Documentation Team
EnrichVersion
6.4
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Design and Development > Designing Jobs > Job Frameworks > Standard
EnrichPlatform
Talend Studio

Procedure

  1. Create a Job named CallRoutineDemo, composed of a tFixedFlowInput, a tMap and a tLogRow component linked by two main rows:
  2. Double click tFixedFlowInput to open its Basic settings view of the Component tab.
  3. Check the Use Inline Content(delimited file) button and add 123456 and abcd in the content field, in order to generate input data.
  4. Click the ellipsis button (...) to edit the schema and add a new column named source_data, as shown below.
  5. Double click tMap to configure it, drag and drop the Source_data row in the output table.
  6. In order to call the routine, add a new column in the output named New_data and enter MyRoutineDemo.reverseString(row1.source_data) into the expression box of the new column:
  7. Double click tLogRow to configure it and select the print the result on the console with table model button.
  8. Execute the Job. The following results will be shown in the console:
    
                            Starting job CallRoutineDemo at 12:18 24/07/2014.
                            [statistics] connecting to socket on port 3987
                            [statistics] connected
                            .-----------+--------.
                            |     tLogRow_1      |
                            |=----------+-------=|
                            |source_data|new_data|
                            |=----------+-------=|
                            |123456     |654321  |
                            |abcd       |dcba    |
                            '-----------+--------'
                            [statistics] disconnected
                            Job CallRoutineDemo ended at 12:18 24/07/2014. [exit code=0]