Using a resource in a Job - Cloud

Talend Cloud API Services Platform Studio User Guide

author
Talend Documentation Team
EnrichVersion
Cloud
EnrichProdName
Talend Cloud
task
Design and Development
EnrichPlatform
Talend Management Console
Talend Studio

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.
    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.
    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.
  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.
    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.