Working with Project Parameters
Project parameters are used to define parameters that have the scope within the Project. These parameters values can be used across all jobs in the Job Flow and data flows to parameterize various properties in them. They can also be used in expressions defined for other parameters in job flow and data flow. The expression defined for Project parameter can consist of any alpha numeric value or Diyotta system parameters.
To define Project Parameters, follow the below steps.
Step I: Open the Parameter User Interface
1. On the Navigation pane, click Parameter.
2. The Parameter User Interface displays the list of parameters defined at project level.
Param Name - Displays the name of the project parameter.
Param Type - Specifies the project parameter with syntax to be used across project. The project parameter name is prefixed with '$PP_'
Data Type - Displays the data type of the project parameter.
Type - This can be either of General Configuration or Sensitive. To secure sensitive information such as password, you can create the parameter type as sensitive and for non-sensitive parameters it can be set as general configuration.
Value - Displays the value specified for the parameter in Expression Editor.
Note: Following operations are allowed on the Parameter entries: Add, Cut, Copy, Paste, Up, Down, Delete, and Search.
Step II: Add or Modify a Project parameter
1. To add a parameter, click Add.
2. Enter the parameter details for new parameter such as Name, data type and type. For reference, here we have added the parameter, Oracle Host of General Configuration type. To enter the value, click on the Expression Editor icon.
To modify existing project parameter, click on the Expression Editor icon against it.
When a Project Parameter type is changed from Sensitive to General Configuration, then the default value for the parameter is automatically set to Diyotta, only if the sensitive value for the parameter was already been given.
3. The Expression Editor window opens, and you can define the parameter value here. The expression defined can include Diyotta System Parameters.. Once you enter the value, click Validate to verify that there are no syntax errors. If everything is correct then, a success message is displayed.
For example, here we have defined an IP address as the Oracle host value.
4. To save the parameter details, on the Actions menu, click Save.
Similarly, the Oracle_Pass project parameter is added as type Sensitive, which consists of password for Oracle connection.
Step III: Usage of Project parameter
Use the project parameter to parameterize properties in different objects in the project. For illustrating the use of project parameter, refer the use cases below.
- In an expression editor, the project parameters can be selected from the project parameters list in the parameters section.
- When project parameter needs to be specified in fields, where expression editor is not available, then type in the project parameter name with $PP_ prefixed.
Use Case I: Using Project Parameters in data points to parameterize the connection properties.
Here, for reference we will use the project parameters Oracle_Host and Oracle_Pass to parameterize the host and password fields. Oracle_Host is defined as general parameter and Oracle_Pass is defined as sensitive parameter.
Step I: Open the Oracle Data Point. For more information, refer Opening Data Point.
Step II: Under Properties, specify Host field as $PP_Oracle_Host. At runtime, the parameter $PP_Oracle_Host will be replaced with the value defined for it.
To know more about Data Point properties for specific Data Point Types, refer Working with respective Data Point Type pages under Working with Data Point.
Step III: Use the project parameter for Password field.
1. For this check the box against Use Project Parameters.
2. The Password drop-down lists the sensitive project parameters under the current project. Select $PP_Oracle_Pass from the list. At runtime, the parameter $PP_Oracle_Pass will be replaced with the value defined for it.
Use Case II: Using project parameter in Data Flow to define Where Clause in source instance
Project parameter can be used in expression editor to define property value or attribute value in Data Flow.
Step I: Open the data flow. For more information, refer Opening Data Flow.
Step II: Click on the source instance and navigate to Properties tab. Then, click on the Expression Editor icon against the Where Clause property. For more information, refer Working with Source Instance Transform.
The Expression Editor window opens.
Step III: Provide the expression to be used as where clause. For illustration, here we are providing expression to check if the value in the column DATE_OFFERED is greater than or equal to project parameter $$PP_Date_Offered. At runtime, the parameter '$PP_Date_Offered' will be replaced with the value defined for it.
Use Case III: Using project parameter in Job Flow to specify path of a file in command task job.
Project parameter can be used in expression editor to define commands or property value.
Step I: Open the job flow. For more information, refer Opening Job Flow.
Step II: Click on the command task job and select the command type as File Watcher. Then, click on the expression editor icon. For more information, refer Working with File Watcher Job.
The Expression Editor window opens.
Step III: Provide the command to be executed. For illustration, here we are specifying the file to be watched for before proceeding to the next job. For path of the file, project parameter $PP_File_Path is used. At run-time, parameter will be replaced with the value defined for it.
Use Case IV: Using project parameter to define the source file path in the extraction property.
The project parameter can be used in fields where expression editor is not available by hardcoding the parameter name. This is applicable in data flow and job flow properties.
Step I: Open the extract properties window for the source instance transform from job flow or data flow. For more details on this, refer Working with Job Flow and Working with Data Flow.
Step II: Use the project parameter in the "value" field for the property "File Name". Here there is no expression editor so, the project parameter needs to be typed in. Prefix it with $PP_ as - $PP_File_Path. At run-time, parameter will be replaced with the value defined for it.