Developer Workflow Guide > Workflow Parameters > Parameter Files
  

Parameter Files

A parameter file is an XML file that lists user-defined parameters and their assigned values. Parameter files provide the flexibility to change parameter values each time you run a workflow.
The parameter values define properties for a workflow or for a mapping included in a Mapping task that the workflow runs. The Data Integration Service applies these values when you run a workflow from the command line and specify a parameter file.
You can define mapping parameters and workflow parameters in a parameter file. If you want to specify reusable object parameters, expose the reusable object parameters as mapping parameters. Specify the mapping parameter values in the parameter file.
You cannot define system parameter values in a parameter file.
You can define parameters for multiple workflows in a single parameter file. You can also create multiple parameter files and then use a different file each time you run a workflow. The Data Integration Service reads the parameter file at the start of the workflow run to resolve the parameters.
You can export a parameter file from the Developer tool. Export the file from the mapping or the workflow Parameters tab. The Developer tool generates a parameter file that contains the mapping or workflow parameters and the default parameter values. You can specify the parameter file name and choose where to save the file.
Note: Parameter files for mappings and workflows use the same structure. You can define parameters for deployed mappings and for deployed workflows in a single parameter file.
You can also list the parameters and default values used in a workflow from the command line. You can use the command line output as a parameter file template.
Run the workflow from the command line to apply a parameter file.

Sample Parameter File for a Workflow

You can create a parameter file for a workflow by running the ListWorkflowParams infacmd. The workflow parameter file does not contain mapping parameters. You can manually add mapping parameters to the file.
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://www.informatica.com/Parameterization/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema"><!--Specify deployed application specific parameters here.--><!--^M
<application name="a2">
<workflow name="w2"/>
</application>--><project name="Orders">
<folder name="integer_op">
<folder name="Workflows">
<workflow name="wf_Orders">
<parameter name="wfStringParam">verboseData</parameter>
<parameter name="wfConnectionParam">OracleDB</parameter>
</workflow>
</folder>
</folder>
</project>
</root>

Sample Parameter File

The following example shows a sample parameter file that you can create for a mapping.
<?xml version "1.0" encodin="UTF-8?>
<root xmlns="http://www.informatica.com/Parameterization/1.0"
xmlns:xsl="http://www.w3.org/2001/XMLSchema">

<project name="sample_project"

<mapping name="m_myMapping"

<parameter name="srcConnect">RelationalConnect</parameter>

<parameter name="srcDirectory">C:\Srcfiles</parameter>

<parameter name="wrkDirectory">C:\TempFiles</parameter>

</mapping>

</project>

</root>

Rules and Guidelines for Parameter Files

Certain rules and guidelines apply when you create parameter files.
Use the following rules when you create a parameter file:

Export a Parameter File

You can export a mapping parameter file or a workflow parameter file from the Developer tool. Define the parameters in the Developer tool and then export them to a file. The Developer tool creates a parameter file in .XML format.
You can export a parameter file that contains mapping parameters or workflow parameters. You can export parameters from the mapping Parameters tab or from the workflow Parameters tab. The Developer tool exports all the parameters from the Parameters tab.
To export a parameter file, perform the following steps:
  1. 1. Define the parameters and the parameter defaults for a mapping or a workflow.
  2. 2. On the Parameters tab of the mapping or workflow Properties, click the Export Parameter File option.
  3. 3. Enter a name for the parameter file and browse for a location to put the file.
  4. 4. Click Save.
The following image shows the Export Parameter File option on the Parameters tab for a workflow:
The workflow Parameters tab has an option called Export Parameter File. The screenshot shows a string workflow parameter called Workflow_Parm. It has a default value of 100.
When you export a parameter file, the Developer tool creates a parameter file with either mapping parameters or workflow parameters in it. The Developer tool does not export mapping and workflow parameters to the same file.
For example, when you export the workflow parameter, Workflow_Parm, the Developer tool creates the following parameter file:
<?xml version="1.0" encoding="UTF-8"?>
-<root version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns="http://www.informatica.com/Parameterization/1.0">
-<project name="Orders">
-<workflow name="Customer_Workflow">
<parameter name="Workflow_Parm">100</parameter>
</workflow>
</project>
</root>

Creating a Parameter File from infacmd ms ListMappingParams

The infacmd wfs ListWorkflowParams command lists the parameters for a workflow in a deployed application and the default value for each parameter. Use the output of this command to create a parameter file.
    1. Run the infacmd wfs ListWorkflowParams command to list the parameters for a workflow and the default value for each parameter.
    The -o argument sends command output to an XML file.
    For example, the following command lists the parameters in workflow MyWorkflow in file "MyOutputFile.xml":
    infacmd wfs ListWorkflowParams -dn MyDomain -sn MyDataIntSvs -un MyUser -pd MyPassword -a MyApplication -wf MyWorkflow -o MyOutputFile.xml
    The Data Integration Service lists all mapping parameters with their default values.
    2. If you did not specify the -o argument, you can copy the command output to an XML file and save the file.
    3. Edit the XML file and replace the parameter default values with the values you want to use when you run the workflow.
    4. Save the XML file.

Running a Workflow with a Parameter File

To run a mapping with a parameter file from the command line, you must deploy the mapping as an application. Run the mapping and specify the parameter file. Use the infacmd wfs StartWorkflow command. The -pf argument specifies the parameter file name.
For example, the following command runs the workflow MyWorkflow using the parameter file "MyParamFile.xml":
infacmd wfs StartWorkflow -dn MyDomain -sn MyDataIntSvs -un MyUser -pd MyPassword -a MyApplication -wf MyWorkflow -pf MyParamFile.xml
The Data Integration Service fails the workflow when you run it with a parameter file and the parameter file is not valid. The Data Integration Service fails the workflow if it cannot find the parameter file or it cannot access the parameter file.
For more information about using parameter sets with infacmd, see the Informatica Command Reference.