Component family |
System |
|
Function |
tRunJob executes the Job called |
|
Purpose |
tRunJob helps mastering complex |
|
Basic settings |
Schema and Edit
(Not available in a Map/Reduce |
A schema is a row description. It defines the number of fields to Click Edit schema to make changes to the schema. If the
This component offers the advantage of the dynamic schema feature. This allows you to This dynamic schema feature is designed for the purpose of retrieving unknown columns |
|
|
Built-In: You create and store the schema locally for this |
|
|
Repository: You have already created the schema and |
|
Copy Child Job Schema
(Not available in a Map/Reduce |
Click to fetch the child Job schema. |
|
Use dynamic job |
Select this check box to allow multiple Jobs to be called and WarningThe Use dynamic job option is WarningThis option is incompatible with the Use |
|
Context job |
This field is visible only when the Use |
|
Job |
Select the Job to be called in and processed. Make sure you |
|
Version |
Select the child Job version that you want to use. |
|
Context |
If you defined contexts and variables for the Job to be run by the |
|
Use an independent process to run subjob
(Not available in a Map/Reduce |
Select this check box to use an independent process to run the WarningThis option is not compatible with the Jobserver cache. WarningThis option is incompatible with the Use |
|
Die on child error |
Clear this check box to execute the parent Job even though there |
|
Transmit whole context |
Select this check box to get all the context variables from the If this check box is selected when the parent and child Jobs have
|
|
Context Param |
You can change the value of selected context parameters. Click the The values defined here will be used during the child Job |
Advanced settings |
Propagate the child result to the output
(Not available in a Map/Reduce |
Select this check box to propagate the output data stored in the This check box is cleared by default. It is invisible when the |
Print Parameters |
Select this check box to display the internal and external |
|
|
tStatCatcher Statistics |
Select this check box to gather the processing metadata at the Job |
Global Variables |
ERROR_MESSAGE: the error message generated by the CHILD_RETURN_CODE: the return code of a child Job. This CHILD_EXCEPTION_STACKTRACE: the exception stack trace A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see Talend Studio |
|
Connections |
Outgoing links (from this component to another): Row: Main.
Trigger: On Subjob Ok; On Subjob Incoming links (from one component to this one): Row: Main; Reject; Iterate.
Trigger: On Subjob Ok; On Subjob NoteIn a Map/Reduce Job, only trigger links are available for this For further information regarding connections, see |
|
Usage |
This component can be used as a standalone Job or can help If you want to create a |
|
Usage in Map/Reduce Jobs |
If you have subscribed to one of the Talend solutions with Big Data, you can also You need to use the Hadoop Configuration tab in the This connection is effective on a per-Job basis. For further information about a Talend Map/Reduce Job, see the sections Note that in this documentation, unless otherwise explicitly stated, a scenario presents |
|
Log4j |
The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html. |
|
Limitation |
The Use dynamic job option of For an alternative solution, see https://help.talend.com/pages/viewpage.action?pageId=27029205 |
This scenario describes a two-component Job that calls another Job, which is the child
Job, to display the content of files specified in the parent Job on the Run log console.
Dropping and linking components
-
Drop a tFileInputDelimited and a
tLogRow from the Palette to the design workspace. -
Connect the two components together using a Row > Main link.
Configuring the components
-
Double-click tFileInputDelimited to open
its Basic settings view and define its
properties. -
Click in the File Name field and then
press F5 to open the [New Context Parameter] dialog box and configure the context
variable. -
In the Name field, enter a name for this
new context variable, File in this example. -
In the Default value field, enter the
full path to the default input file. -
Click Finish to validate the context
parameter setup and fill the File Name
field with the context variable.Note
You can also create or edit a context parameter in the Context tab view beneath the design
workspace. For more information, see Talend Studio User
Guide. -
Click the […] button next to Edit schema to open the [Schema] dialog box where you can configure the schema
manually. -
In the dialog box, click the [+] button
to add columns and name them according to the input file structure.In this example, this component will actually read files defined in the
parent Job, and these files contain up to five columns. Therefore, add five
string type columns and name them col_1,
col_2, col_3, col_4, and
col_5 respectively, and then click
OK to validate the schema configuration
and close the [Schema] dialog box. -
Double-click tLogRow to display its
Basic settings view and define its
properties. -
Select the Table option to view displayed
content in table cells.
Dropping and linking components
-
Drop a tFileList and a tRunJob from the Palette to the design workspace.
-
Connect the two components together using an Iterate link.
Configuring the components
-
Double-click tFileList to open its
Basic settings view and define its
properties. -
In the Directory field, specify the path
to the directory that holds the files to be processed, or click the
[…] button next to the field to
browse to the directory.In this example, the directory is called tRunJob and
it holds three delimited files with up to five columns. -
In the FileList Type list, select
Files. -
Check that the Use Glob Expressions as
Filemask check box is selected, and then click the [+] button to add a line in the Files area and define a filter to match files. In
this example, enter"*.csv"
to retrieve all delimited files. -
Double-click tRunJob to display its
Basic settings view and define its
properties. -
Click the […] button next to the
Job field to open the [Find a Job] dialog box. -
Select the child Job you want to execute and click OK to close the dialog box. The name of the selected Job
appears in the Job field. -
In the Context Param area, click the plus
button to add a line and define the context parameter. The only context
parameter defined in the child Job, named File, appears in the Parameter cell. -
Click in the Values cell, press Ctrl+Space on your keyboard to access the list of
context variables, and select
tFileList-1.CURRENT_FILEPATH.The corresponding context variable appears in the Values cell:
((String)globalMap.get("tFileList-1.CURRENT_FILEPATH"))
.Note
For more information on context variables, see Talend Studio User Guide.
-
Press Ctrl+S to save your Job.
-
Press F6 to execute the Job.
The parent Job calls the child Job, which reads the files defined in the
parent Job, and the content of the files is displayed on the Run console.
Related topic: tLoop, and Scenario 1: Buffering data of the
tBufferOutput component.
This scenario describes a Job that calls two child Jobs dynamically. When called from
the parent Job, each of these simple child Jobs displays a message on the
console.
-
Create a Job named child_1, and add two
components by typing their names on the design workspace or dropping them
from the Palette:-
a tFixedFlowInput, to generate a
message -
a tLogRow, to display the
generated message on the console.
-
-
Connect the tFixedFlowInput component
tLogRow using a Row > Main
connection. -
Double-click the tFixedFlowInput
component to open its Basic settings
view. -
Click the […] button next to Edit schema to open the [Schema] dialog box and define the schema of the input
data.In this example, the schema has only one column: Message (type string).
When done, click OK to close the dialog
box and click Yes when prompted to
propagate the schema to the next component. -
Select the Use Inline Content option, and
enter the message you want to show on the console in the Content field, Hello
World! in this example. -
In the Basic settings view of the
tLogRow component, select the Table mode to display the execution result in
table cells. -
Create copy of this Job and name it child_2, and enter another message in the Content field of the tFixedFlowInput component, Hello
Talend! in this example. -
Press Ctrl+S to save the Jobs.
Adding and link components
-
Create a new Job and add the following components by typing their names on
the design workspace or dropping them from the Palette:-
a tFixedFlowInput, to specify a
list of Jobs to be called dynamically, -
a tFlowToIterate, to iterate on
the input rows and store the content into an iterative global
variable, -
a tRunJob, to load and run the
child Jobs
-
-
Connect the tFixedFlowInput component to
the tFlowToIterate component using a
Row > Main connection. -
Connect the tFlowToIterate component to
the tRunJob component using a Row > Iterate
connection.
Configuring the components
-
Double-click the tFixedFlowInput
component to open its Basic settings
view. -
Click the […] button next to Edit schema to open the [Schema] dialog box and define the schema of the input
data.In this example, the schema has only one column: Job (type string).
When done, click OK to close the dialog
box and click Yes when prompted to
propagate the schema to the next component. -
Select the Use Inline Content option, and
specify the names of the child Jobs to call from the parent Job in the
Content field:12child_1child_2 -
Double-click the tRunJob component to
open its Basic settings view. -
Select the Use dynamic job check
box. -
Click in the Context job field, press
Ctrl+Space and from the list of
variables select the iterative global variable created by the tFlowToIterate component, Job in this example. The Context
job field is then filled with
((String)globalMap.get("row1.Job"))
. Upon each iteration,
this variable will be resolved as the name of the Job to be called. -
Click the […] button next to the
Job field to open the [Select Job] dialog box. Select all the Jobs you
want to run and click OK to close the
dialog box.
-
Press Ctrl+S to save the Job.
-
Press F6 or click the Run button on the Run console to execute the Job.
The child Jobs are called one after another and messages specified in the
child Jobs are displayed on the console.
In this scenario, a three-component Job calls a two-component child Job and displays
the buffered output data of the child Job, instead of the data from the input flow of
the parent Job, on the console.
-
Create a Job named child, and add two
components by typing their names on the design workspace or dropping them
from the Palette to the design
workspace:-
a tFixedFlowInput, to generate a
message -
a tBufferOutput, to store the
generated message in the buffer memory
-
-
Connect the tFixedFlowInput component to
the tBufferOutput component using a
Row > Main connection. -
Double-click the tFixedFlowInput
component to open its Basic settings
view. -
Click the […] button next to Edit schema to open the [Schema] dialog box and define the schema of the input data.
In this example, the schema has only one column message of the string type.When done, click OK to validate the
changes and then click Yes in the pop-up
[Propagate] dialog box to propagate the
schema to the next component. -
In the Mode area, select Use Single Table option, and define the
corresponding value for the message
column in the Values table. In this
example, the value is “message from the child
job”.
-
Create a Job, and add three components by typing their names on the design
workspace or dropping them from the Palette
to the design workspace:-
a tFixedFlowInput, to generate a
message -
a tRunJob, to call the Job named
child -
a tLogRow, to display the
execution result on the console
-
-
Connect the tFixedFlowInput component to
the tRunJob component and the tRunJob component to the tLogRow component using the Row > Main
connections. -
Double-click the tFixedFlowInput
component to open its Basic settings
view. -
Click the […] button next to Edit schema to open the [Schema] dialog box and define the schema of the input data.
In this example, the schema has only one column message of the string type.When done, click OK to validate the
changes. -
In the Mode area, select the Use Single Table option, and define the
corresponding value for the message
column in the Values table. In this
example, the value is “message from the parent
job”. -
Click the tRunJob component and then
click the Component tab to open its
Basic settings view. -
Click the Sync columns button and then
click Yes in the pop-up [Propagate] dialog box to retrieve the schema
from the preceding component. -
Click the […] button next to the
Job field to open the [Repository Content] dialog box.In the [Repository Content] dialog box,
select the Job named child and then click
OK to close the dialog box. -
In the Advanced settings view of the
tRunJob component, select the Propagate the child result to the output schema
check box. With this check box selected, the buffered output of the child
Job will be propagated to the output component.