Working with User Parameters
User parameters are parameters that you expose in the workspace. This is useful if you want to set visible default values, or if you want to be able to easily change a parameter from workspace to workspace.
User parameters can include:
- source and destination datasets
- feature types
- certain transformer values
- log files
- coordinate systems
There are two main types of user parameters: Published and Private.
Published or Private Parameter?
When you define Published Parameters, you can choose to be prompted for information that might change when the workspace is run. This makes the workspace more portable. For more information, see Running a Workspace with Published Parameters.
Published Parameters display in the log file as they would appear on the command line, which allows for simpler migration of workspaces to a command-based environment.
Private Parameters are used internally, mainly to share a parameter value across multiple transformers. For example, multiple SchemaMappers may reference a single parameter for its schema mapping table dataset. You can also create parameters for username/password fields in commonly accessed database tables.
Private Parameters are nearly identical to Published Parameters, but they have the following differences:
- Prompt-and-run does not prompt for Private Parameter values.
- The command line, at the top of the translation log and
.fmw
file, does not show the command line argument to set Private Parameters. (However, since they are macros in the mapping file, you can still modify them.)
Note: You can always convert between parameter types by right-clicking on the parameter in the Navigator and selecting Convert to Published Parameter or Convert to Private Parameter.
Creating User Parameters
When you create a user parameter, you specify whether it is published or private, along with other properties. For more information about how to create different types of user parameters, see Creating and Modifying User Parameters.
Using Parameters
Once you create a user parameter, you can use it in several ways:
- Right-click on the parameter and select Apply To to apply that parameter to another setting in the workspace.
- Right-click any workspace setting in the Navigator and select Link to Parameter. The resulting dialog contains a list of any newly created parameters (Published and Private). Pick one and click OK to set the link.
- Use the ParameterFetcher transformer with the parameter name specified.
Examples
The FME Knowledge Center includes additional information and examples of published parameters.