Calling a Talend Job from an external Java application
Talend Studio constructs a Java environment. You can execute any Java code using Java components like tJava or tJavaRow. You can customize Java code in a routine. In addition, Talend Studio allows you to export the Job script and call it from external Java applications like Eclipse or Netbean.
This procedure explains how to call a Talend Job from a Java program in Eclipse.
Create a demo Job
This example begins by creating an example Job called CallJobInEclipseDemo.
In this Job, you will:
- Define two context variables: nb_line and name.
- Use a tFixedFlowInput component to create rows of data and append them to a file named D:/file/out.txt.
Procedure
Integrate the Talend Job into Eclipse
Follow the steps to import the Talend Job into a Java project in Eclipse:
Procedure
Pass new values to context variables
You can also pass new values to the context variables when calling a Talend Job in a Java program. This functionality is useful in real-world cases, because the values may be provided by other code snippets.