Introduction
Informatica Cloud allows overriding the Input and In-Out parameters defined in a mapping and Parameter Files defined in a mapping task by passing values from the taskflows.
You can use Data Task step or an Assignment step in taskflow to pass values to the mapping task containing parameters and parameter file defined to override their values.
Let us understand the process of overriding Parameters, Parameter Files from IICS Taskflows in this article using an example.
Overriding Connections using Taskflows in Informatica Cloud
In our earlier article, we have discussed how to parameterize connections and data objects using parameter file.
Let us now understand how to parameterize connections and data objects using taskflows by overriding parameters and parameter files.
Source and Target details
Consider a mapping with simple source and target transformations. Parameterize the source and target connections and data objects by creating Input parameters.
- Src_Connection Input parameter of type connection to parameterize source connection.
- Src_Object Input parameter of type data object to parameterize source object.
- Tgt_Connection Input parameter of type connection to parameterize target connection.
- Tgt_Object Input parameter of type data object to parameterize target object.
Make sure Allow parameter to be overridden at run time option is unselected while creating the parameters. Else you will not be able to override the parameter values from taskflow.
This option, when selected, lets the value defined in mapping task to be overridden by the value defined in the parameter file but not from taskflow.
- To override the parameter values using Parameter file, select this option.
- To override the parameter values using taskflow, unselect this option.
In the Mapping Task, you need to assign values to these parameters. The Mapping task uses Oracle Connection to read data from EMPLOYEES table and FlatFile_Connection to write to emp.csv file.
These values can later be overridden from the taskflow. Keep in mind that the default data object defined in the Mapping task and the data object you wish to override should have same metadata with same field names and data types.
Method-1: Overriding the Parameters
Follow below steps to override the parameters from taskflow
1. Create a taskflow and add a Data Task step to the canvas.
2. Go to Data Task step and add the mapping task with the parameters.
3. Go to Input Fields, click the Add icon. You could see the input parameters defined in the mapping as below.
4. Perform the following steps to override the connection parameter
- Select the connection parameter from the list of parameters.
- Click Edit. The Edit Value dialog box opens.
- Select Field type as Content.
- Select the Connection Value from the list of connections available.
5. Perform the following steps to override the data object parameter
- Select the data object parameter from the list of parameters.
- Click Edit. The Edit Value dialog box opens.
- Select Field type as Content.
- Enter the value for the data object you wish to create.
6. Repeat same steps for all the additional connection and data object parameters you wish to override from taskflow
The below image shows the target connection and target object values are overridden with new values FF_TargetFiles and object TF_Override.csv respectively in taskflow.
You only need to add parameters that you want to override to the Input Fields section.
The below image shows that the task completed successfully and the target connection and data object values defined in the taskflow are picked.
Method-2: Overriding the Parameter Files
Consider the Allow parameter to be overridden at run time option is selected while creating the parameters. In this scenario even if you pass the values to the parameters from taskflow to override, those values will not be considered.
The values to the parameters should be passed from a parameter file to override the parameter values. Consider you have defined a parameter file in the mapping task to override the parameter values.
The below image shows the runtime parameters read from the parameter file to override the parameters defined in the mapping.
Though you cannot override the parameters from the taskflow in this scenario, you could override the parameter file from taskflow which overrides the parameter values.
Create a new parameter file with parameter values you wish to override. Below are the contents of the parameter file mct_ParamFile_Override_demo_2.param which overrides the existing parameter file from taskflow
#USE_SECTIONS
[POC].[c]
$$Src_Connection=Oracle_Connection
$$Src_Object=EMPLOYEES
$$Tgt_Connection=FF_TargetFiles
$$Tgt_Object=Taskflow_Override.csv
[Global]
Follow below steps to override the Parameter File Directory and Parameter File Name from taskflow
1. Create a taskflow and add a Data Task step to the canvas.
2. Go to Data Task step and add the mapping task with the parameters.
3. Go to Input Fields, click the Add icon. You could see task properties parameters as below.
5. Perform the following steps to override the parameter file name
- Select Parameter File Name under Task Properties Parameters.
- Click Edit. The Edit Value dialog box opens.
- Select Field type as Content.
- Enter the name for the parameter file.
The below image shows that parameter file is overridden with new file mct_ParamFile_Override_demo_2.param in taskflow.
You could also override the Parameter File Directory path using the same steps. Since we only want to override the parameter file name, directory is not selected here.
The below image shows that the task completed successfully and the parameter values are picked from the Parameter File defined in the taskflow.
Override Precedence between a Parameter File and Taskflow in various scenarios
Only parameters of type Connection and Data Object have the Allow parameter to be overridden at run time option to choose whether to override the parameter values from a Parameter File or a Taskflow.
Rest of the parameter types can be overridden from both parameter file and taskflow. Similarly all In-Out Parameters also can be overridden from both parameter file and taskflow.
What if we try to override the parameter values from both Parameter File and TaskFlow?
Which one would take precedence?
Here is a complete override precedence details in all the various scenarios for Input and In-Out Parameters using Parameter File and Taskflow
Parameter | Allow parameter to be overridden at run time | Assigned values in Parameter File | Assigned values in Taskflow | Override value Precedence |
Input Parameter | – | Yes | No | Parameter File |
Input Parameter | – | No | Yes | Taskflow |
Input Parameter | – | Yes | Yes | Taskflow |
Input Parameter | – | No | No | Runs with default value assigned in Mapping Task |
Input Parameter | Enabled | Yes | No | Parameter File |
Input Parameter | Enabled | No | Yes | Runs with default value assigned in Mapping Task |
Input Parameter | Enabled | Yes | Yes | Parameter File |
Input Parameter | Enabled | No | No | Runs with default value assigned in Mapping Task |
Input Parameter | Disabled | Yes | No | Runs with default value assigned in Mapping Task |
Input Parameter | Disabled | No | Yes | Taskflow |
Input Parameter | Disabled | Yes | Yes | Taskflow |
Input Parameter | Disabled | No | No | Runs with default value assigned in Mapping Task |
In-Out Parameter | – | Yes | No | Parameter File |
In-Out Parameter | – | No | Yes | Taskflow |
In-Out Parameter | – | Yes | Yes | Parameter File |
This might be little confusing if you initially look at it. But I am sure if you go case by case, it starts making sense and easy to understand.
Conclusion
To summarize, you can override the parameter values using both Parameter File and Taskflow. You should just keep in mind which would take precedence in which scenario.
You could also use the parameters defined in the parameter file directly in the mapping especially in the override queries without actually creating the parameter in the mapping. This case is not considered in our above discussion.
In this case you cannot override these parameter values from taskflow as they are not defined in the mapping at all. But you could override the complete parameter file to change the parameter values.
Related Posts: