ParameterFetcher

From fmepedia

ParameterFetcher is a Workbench Transformer.


Table of contents


Description

This transformer grabs a parameter (really, an FME MACRO) and copies its value to an attribute. At this time (2007-beta) the only way to select the parameter is by typing in the name, but hopefully that will change shortly to permit any existing published parameter to be selected from a picklist.

This is of use to those running workspaces in batch or from the command line -- any command line argument can be retrieved this way. For example, if this command line was executed:

  fme myworkspace.fmw --NUMBEROFTILES 30

the ParameterFetcher could retrieve the NUMBEROFTILES parameters and assign its value (30) into an attribute.

This will be useful in permitting a parameter to be converted to an attribute for use in a transformer such as the Tester where the published setting is an entire string.



Command Line Example

The attached workspace shows an example use of the ParameterFetcher transformer.


A parameter in FME is what was once called a macro. It's a setting that a user can pass values into when a translation is run. Normally the parameter relates to a setting on a reader or transformer. However, the ParameterFetcher can be used to grab the value of that parameter and create it as an attribute.


In this example the transformer grabs the value of a parameter called "abcd" and copies it to an attribute called "result". In this case the parameter is defined via the command line, but it could equally have been created by publishing a parameter within Workbench.


Workspace Screenshot


Above: ParameterFetcher workspace. The ParameterFetcher is set up to read a parameter called abcd


Command Line Screenshot


Above: The workspace being called from the command line. Note how abcd has a defined value.


Output Screenshot


Above: The result shown in FME Viewer. Note how the value from abcd has been put into a new attribute.

Attached Files
filesizedate
ParameterFetcher Example Output.jpg20.3 kB11/13/08
ParameterFetcher Example.jpg15.5 kB11/13/08
ParameterFetcher Example.zip55.9 kB11/13/08
ParameterFetcher Example2.jpg39.0 kB11/13/08
User Comments Add a new comment