Using a resource in a Job - Cloud - 7.3

Talend Studio User Guide

Version
Cloud
7.3
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Cloud
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development
Last publication date
2024-02-13

You can use a resource in a Job by adding a context variable in the Contexts view of the Job.

Note: Using resources through repository context variables is not supported yet.

Procedure

  1. Create a resource by following the instructions in Creating a resource.

    Example

    In this example, create a resource named AirportInfo to read airport information a local text file.
  2. Open the Job in which you want to use the resource.

    Example

    In this example, the Job has only two components -- tFileInputDelimited and tLogRow, connected by a Row > Main connection.
  3. In the Contexts view of the Job, add a context variable, named resourceFile in this example, of type Resource.

    Example

  4. Click in the Value field of the context variable, click the button and select the resource in the Select a Resource dialog box.
  5. In the Component view of the tFileInputDelimited component, define the component schema according to the structure of the resource content.
  6. In File name/Stream field, specify the resource context variable.

    Example

    In this example, enter context.resourceFile.

Results

When executed, the Job will read and display the content of the input file defined in the resource. You can export the Job with the input file as a Job dependency, and deploy it to a different system without copying the file to the target machine.