Configuring the parent Job
Procedure
-
In the Context view:
-
Add the following three variables:
- filename, type String
- tablename, type String
- directory, type Directory
-
Specify the directory by clicking in the Value field of variable directory. Click the small button that
appears and browse to the directory where the source files are
stored.
-
Add the following three variables:
-
In the Basic settings view of the
tFileList component, fill the
Directory field with
context.directory.
Information noteTip: Click in the field and press Ctrl+Shift to access a list of available variables.
-
Double-click the tIterateToFlow component to open its
Basic settings view, and configure the component as
follows:
- Add a column named filename (type String) in the schema editor.
- Fill the Value field of the Mapping table with the CURRENT_FILE global variable generated by the tFileList component, in the format of ((String)globalMap.get("tFileList_1_CURRENT_FILE")).
-
Double-click the tFixedFlowInput component to open its
Basic settings view, and configure the
component:
- Add two columns in the schema: file_name (type String) and table_name (type String).
-
Select the Use Inline Table option, and define
the following file-to-table mappings in the table:
file_name table_name "customer_details.csv" "customer" "delivery_details.csv" "delivery" "employee_details.csv" "employee"
-
Double-click the tMap component to open the map editor. In
the map editor:
- Drag the filename column of table row1 (which is from the tIterateToFlow component) and drop it onto the file_name column of table row2 (which is from the tFixedFlowInput component), to join the two tables for file name look-up.
-
Click the spanner button to show the join properties, and set:
- the Match Model to Unique match
- the Join Model to Inner Join
- In the schema editor, add two columns to the out table: tablename (type String) and filename (type String).
- Drag the filename column of table row1 and drop it onto the filename column of table out.
-
Drag the table_name column of table
row2 and drop it onto the
tablename of table out.
- Click OK to validate your settings and close map editor.
-
Double-click the tJavaRow component, and enter the
following code in the Code field.
context.tablename = out.tablename; context.filename = out.filename;
-
In the Basic settings view of the
tRunJob component:
- Click the three-dot button next to the Job field and select the child Job you want to call from the Repository Content dialog box, LoadDynamicSchemaChild in this example.
- Select the Transmit whole context option to pass the context variables to the child Job.
- Press Ctrl+S to save the Job.
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!