Taskflows > Taskflows > Parameters in taskflows
  

Parameters in taskflows

You can use a taskflow to pass input parameters and in-out parameters to a task.
You can design a mapping with input parameters or in-out parameters. When you add a mapping task to a taskflow, you can override the parameter values. The mapping task passes these parameters to the mapping. You can use the parameterized mapping task in different scenarios.
If a PowerCenter task uses input parameters or in-out parameters, you can override the parameters in a taskflow.
The following section explains input and in-out parameters and how you can use them in a taskflow:
Input parameters
An input parameter is a placeholder for a value or values in a mapping or PowerCenter task. You define the value of the parameter when you configure the mapping task or PowerCenter task. For more information about input parameters, see Mappings and Tasks.
If a PowerCenter task uses input parameters, you can override the input parameters in a taskflow.
You can use a taskflow to override the following subset of mapping input parameters:
For example, consider a fully parameterized mapping task. The mapping task uses an SQL connection to read from the employeeaddress table and a JDBC connection to write to the employeedetails table.
You can create a taskflow and override parameters in the mapping task. For example, you can use a Salesforce connection to read from the employeeincome table and a flat file connection to write to the file income.txt.
In-Out parameters
An in-out parameter is a placeholder for a value that can you can pass in to or out of a mapping or PowerCenter task. Unlike input parameters, an in-out parameter can change each time a task runs. You can use a taskflow to override any type of in-out parameters that a mapping task or PowerCenter task supports. For more information about in-out parameters, see Mappings and Tasks.
For example, consider a mapping that keep tracks of how many rows it processes using an in-out parameter named lastprocessedindex. Every time you run the mapping, it resumes processing from this index. And also, let us say that every time the mapping is executed, it processes 5000 rows.
You can configure the taskflow such that the mapping task runs till it reaches records number, say, 50000.

Overriding parameters in a taskflow

Override the parameters of a task when you use it in a taskflow. You can override parameters with the Data Task step or with the Assignment step.

Overriding parameters or parameter files in a Data Task step

If the Data Task step uses a PowerCenter task or mapping task, you can override the parameter values of the task. If the Data Task step uses a mapping task, you can override the parameter file directory and parameter file name of the mapping task.
Perform the following steps to use a Data Task step to override a Data Integration parameter or parameter file:
    1. Create a taskflow and add a Data Task step.
    2. Add a task that contains parameters or uses a parameter file to the Data Task step.
    3. Go to Data Task > Input Fields.
    4. Click Add.
    5. Perform one of the following steps:
    1. a. To override the parameter file directory or parameter file name of a mapping task, expand the TaskProperties Parameters list. Then, select Parameter File Directory or Parameter File Name.
    2. b. To override an input parameter or in-out parameter of a mapping task or PowerCenter task, expand the Input Parameters or InOut Parameters list. Then, navigate to and select the parameter that you want to override.
    6. Click Edit.
    The Edit Value dialog box appears.
    7. Under Source, select Content. For advanced use cases, you might select Field or Formula.
    8. Under Value, enter the new parameter file directory, parameter file name, or parameter value that you want to override the default value with.
    9. Click OK.

Overriding parameters with an Assignment step

Perform the following steps to use an Assignment step to override a Data Integration parameter:
    1. Create a taskflow and add a Data Task step.
    2. Add a mapping task that contains input parameters to the Data Task step.
    3. Drag an Assignment step onto the canvas.
    4. Go to Assignment Properties > Assignments.
    5. Click the Add icon, and then navigate to and select the parameter you want to override.
    6. Under Value, select Content. For advanced use cases, you might select Field or Formula.
    7. Enter or select the object or connection that you want to use to override the default object or connection.

Guidelines and best practices for using parameters in a taskflow

The following sections describe guidelines and best practices when overriding parameters in a taskflow.

Guidelines for using input parameters in taskflows

Use the following guidelines when you use input parameters in a taskflow:

Guidelines for using in-out parameters

Use the following guidelines when you use in-out parameters in a taskflow:

Example: Overriding parameters with a Data Task step

You want to override the following input parameters in a mapping task, MyMT :
MyMT uses My File Connection to read from the input.txt file and My File Connection to write to the output5.txt file.
You want MyMT to use My File Connection read from the input.txt file and use table and then use My File Connection to write to another output file, output10.txt file.
To do this, perform the following steps to override the default value of MyTargetObject with a Data Task step:
    1. Create a taskflow and add a Data Task step, Data Task 1.
    2. Go to Data Task 1 > Data Task and add the mapping task MyMT.
    3. Go to Data Task 1 > Input Fields.
    4. Perform the following steps to add MySourceConnection to the Input Fields section of Data Task 1:
    1. a. Click the Add icon, and then navigate to and select MySourceConnection.
    2. b. Click Edit. The Edit Value dialog box opens.
    3. c. In the field next to Source, select the Content.
    4. d. In the field next to Value, select My File Connection.
    5. Perform the following steps to add MySourceObject to the Input Fields section of Data Task 1:
    1. a. Click the Add icon, and then navigate to and select MySourceObject.
    2. b. Click Edit. The Edit Value dialog box opens.
    3. c. In the field next to Source, select Content.
    4. d. In the field next to Value, enter input.txt.
    6. Perform the following steps to add MyTargetConnection to the Input Fields section of Data Task 1:
    1. a. Click the Add icon, and then navigate to and select MyTargetConnection.
    2. b. Click Edit. The Edit Value dialog box opens.
    3. c. In the field next to Source, select Content.
    4. d. In the field next to Value, select My File Connection.
    7. Perform the following steps to add MyTargetObject to the Input Fields section of Data Task 1:
    1. a. Click the Add icon, and then navigate to and select MyTargetObject.
    2. b. Click Edit. The Edit Value dialog box opens.
    3. c. In the field next to Source, select Content.
    4. d. In the field next to Value, enter output10.txt.
    The following image shows the Input Fields of Data Task 1:
    The Input Fields section of Data Task 1. There are four parameters. The target object paramater has been overridden from its default value of output5.txt to output10.txt.
You have overridden the target data object parameter, MyTargetObject from the default value output5.txt to output10.txt.
Note: You only need to add parameters that you want to override to the Input Fields section. In this example, you only override MyTargetObject. However, you have the option of overriding MySourceObject, MySourceObject, and MyTargetConnection as well.