Skip to main content
Pentaho Documentation

Job Executor

Parent article

The Job Executor step allows you to execute a Pentaho Data Integration (PDI) job. It is similar to the Transformation Executor step, but works with jobs. By default, the specified job will be executed once for each input row. You can use the input row to set parameters and variables. The executor step then passes this row to the job in the form of a result row.

You can also pass a group of records based on the value in a field, such that when the value changes, the specified job is executed. In these cases, the first row in the group of rows is used to set parameters or variables in the job.

You can also launch multiple copies of this step to assist in parallel job processing.

NoteThis step does not abort when the calling job errors out. To control the flow or to abort the job incase of errors, please specify the fields and a target step in the Execution results tab to log the number of errors.

Samples

The following sample transformation and job, which demonstrate the capabilities of this step, are available in the distribution package in the design-tools/data-integration/samples/transformations/job-executor folder.

  • test-trans.ktr

    Passes three rows ('one,' 'two,' 'three') to a job that is then executed three times. It sets a parameter to three different values. You can preview the Results, Result files, and Result rows steps to view the output.

  • test-job.kjb

    Displays a message box with the value and set of the result files.

Samples

General

Enter the following information in the transformation step fields.

OptionDescription
Step NameSpecifies the unique name of the transformation on the canvas. A transformation can be placed on the canvas several times; however, it represents the same transformation. The Step Name is set to Job Executor by default.
Job

Specify your job to execute by entering its path or clicking Browse.

If you select a job that has the same root path as the current job, the variable ${Internal.Entry.Current.Directory} will automatically be inserted in place of the common root path. For example, if the current job's path is /home/admin/transformation.kjb and you select a job in the folder /home/admin/path/sub.kjb than the path will automatically be converted to ${Internal.Entry.Current.Directory}/path/sub.kjb.

If you are working with a repository, specify the name of the job. If you are not working with a repository, specify the XML file name of the job.

Jobs previously specified by reference are automatically converted to be specified by the job name within the Pentaho Repository.

Options

The Job Executor step features several tabs with fields for setting parameters and defining results. Each tab is described below.

Parameters tab

Parameters tab

This tab allows you to define or pass variables and/or parameters to the job. If multiple rows are passed to the job, the first row can be used to set the parameters or variables.

OptionDescription
Variable/Parameter nameSpecify the name of the variable or parameter.
Field to use Specify which field to set the particular parameter or variable value. If you specify an input field to use, the static input value is not used.
Static input value Instead of a field, specify a static value to use.
Inherit all variables from transformation When this check box is selected, all the variables defined in the parent transformation are passed to the child transformation.
Get ParametersClick this button to insert all the defined parameters of the specified transformation. The description of the parameter is inserted into the static input value field.

Execution results tab

Execution results tab

You can define the result fields for the job and to which step in the transformation to send them. If you do not need a certain result, leave a blank input field.

OptionDescriptionDefault Value
Target step for the execution resultsUse the drop-down menu to select a step in the transformation as the target step to receive the results from the job.N/A
Execution time (ms)Specify the field name for the job execution time.ExecutionTime
Execution resultSpecify the field name for the job execution result.ExecutionResult
Number of errorsSpecify the field name for the number of errors during the execution of the job.ExecutionNrErrors
Number of rows readSpecify the field name for the total number of rows read during the execution of the job.ExecutionLinesRead
Number of rows writtenSpecify the field name for the total number of rows written during the execution of the job.ExecutionLinesWritten
Number of rows inputSpecify the field name for the total number of input rows during the execution of the job.ExecutionLinesInput
Number of rows outputSpecify the field name for the total number of output rows during the execution of the job.ExecutionLinesOutput
Number of rows rejectedSpecify the field name for the total number of rows rejected during the execution of the job.ExecutionLinesRejected
Number of rows updatedSpecify the field name for the total number of rows updated during the execution of the job.ExecutionLinesUpdated
Number of rows deletedSpecify the field name for the total number of rows deleted during the execution of the job.ExecutionLinesDeleted
Number of files retrievedSpecify the field name for the total number of files retrieved during the execution of the job.ExecutionFilesRetrieved
Exit statusSpecify the field name for the exit status of the execution of the job.ExecutionExitStatus
Execution logging textSpecify the field name for the logging text from the execution of the job.ExecutionLogText
Log channel IDSpecify the field name for the log channel ID used during the execution of the job.ExecutionLogChannelID

Row grouping tab

Row grouping tab

Specify how to group the result rows by one of the following methods:

  • Specific number of rows.
  • Specific field.
  • Specified duration of time.

You can use the result rows in a transformation or job entry, or you can get the records themselves by using the Get rows from result step in a transformation.

To access the Field to group rows on or Duration time when collecting rows options, delete the default value in the Number of rows to send to transformation option.

Option Description
Number of rows to send to transformationSpecify a number. After every n number of rows, the job will be executed and these n rows will be passed to the transformation.
Field to group rows on Specify a field for grouping rows. Rows will be collected in a group as long as the field value stays the same. If the value changes, the job will be executed and the accumulated rows will be passed to the transformation.
Duration time when collecting rowsSpecify a time in milliseconds. This value is the amount of time the step will spend collecting rows prior to the execution of the job.

Results rows tab

Result rows tab

In this tab, you can specify the destination of the result rows from the job execution as well as the layout of the expected result rows.

NoteThis step will verify that the data type of the result row fields are identical to what is specified. If there is a difference, an error message will display.
OptionDescription
Target step for result rowsUse the drop-down menu to select a step in the transformation as the target step.
Field nameSpecify the name of the field.
Data typeUse the drop-down menu to specify the data type of the field, such as number, date, or string.
LengthIf applicable, specify the length of the field.
PrecisionIf applicable, specify the precision to use.

Result files tab

Result files tab

In this tab, specify the destination of the result files.

OptionDescription
Target step for result files informationUse the drop-down menu to select a step in the transformation as the target step.
Result file name fieldSpecify the name of the field for the result files.