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.

You can create user parameters to set many different types of data, such as references to datasets, attributes, coordinate systems, grid shift files, geometries, database and web connections, text, numbers, dates, and others.

Published or Private Parameter?

There are two main kinds of user parameters: Published and Private.

Published Parameters

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.

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.

Note: Reader and Writer dataset parameters are published by default. If, for example, a file is missing, you will see a warning.

For more information, see Running a Workspace with Published Parameters.

Private Parameters

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.)

Creating User Parameters

When you create a user parameter, you specify the type of parameter, whether it is published or private, and all of its other properties. For more information, 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 Duplicate to create another parameter with similar settings, and edit as desired.
  • Right-click on the parameter and select Copy. To reuse the parameter in another workspace, right-click in the canvas and select Paste. The parameter is applied to the new workspace, along with any other parameters it references.
  • Right-click on the parameter and select Apply To to apply that parameter to another setting in the workspace.
  • Use the ParameterFetcher transformer with the parameter name specified.

Examples

The FME Community includes additional information and examples of published parameters.