GUI Types in Transformer (*.fmx) Files

Usage

In files that define FME's transformers, you will see GUI types being used in blocks such as:

PARAMETER_NAME: stringVariable
PARAMETER_TYPE: TEXT
PARAMETER_PROMPT: Enter some text:
PARAMETER_DEFAULT: This is the default text

A PARAMETER_* block defines an input parameter for the transformer. This block may be repeated multiple times, one for each parameter.
The above example will create a text input field that has the label "Enter some text:" with the string "This is the default text" already entered in the input field. The value of this field is stored in the macro stringVariable.
The parameter type also has two optional prefixes: OPTIONAL, which specifies that the parameter can be blank, and WHOLE_LINE, which specifies that the line the parameter appears on will be removed if the parameter is blank. For example:

PARAMETER_NAME: optionalStringVariable
PARAMETER_TYPE: OPTIONAL TEXT
PARAMETER_PROMPT: Enter some additional text:
PARAMETER_DEFAULT:

Syntax

The following describes the general syntax for using the various GUI types available. Syntax specific to each GUI type can be found by selecting the appropriate type from the menu on the left.
The PARAMETER_* block will take the following format:

PARAMETER_NAME: <macroName>
PARAMETER_TYPE: [OPTIONAL] [WHOLE_LINE] COMMAND <configString>
PARAMETER_PROMPT: <label>
PARAMETER_DEFAULT: <defaultValue>
[PARAMETER_LOOKUP: <choice1>%<choice2>%<choice3>]

where

See below for more information on the PARAMETER_LOOKUP directive.

PARAMETER_LOOKUP

The PARAMETER_LOOKUP directive is special, and is only used if the parameter is an ACTIVECHOICE, CHOICE or LISTBOX type. It allows you to use full-length English versions of each option in the CHOICE line, providing a nice alternative to obscure factory directives. Macro name used in PARAMETER_LOOKUP directive cannot be the same as the name used for PARAMETER_NAME directive. Once PARAMETER_LOOKUP is defined, then the template section of the transformer should use the macro name defined in PARAMETER_LOOKUP directive.
NOTE: CHOICE type parameter must use PARAMETER_LOOKUP so that the choice options can be localized.
Here's an example:

PARAMETER_NAME: OBSCURE_PARAM
PARAMETER_TYPE: CHOICE "A description of an obscure option"%"Another description"
PARAMETER_LOOKUP: OBSCURE_PARAM_LOOKUP OBSCURE_DIRECTIVE%ANOTHER_OBSCURE_DIRECTIVE
.
.
.
TEMPLATE_START
FACTORY_DEF * TestFactory
FACTORY_NAME $(XFORMER_NAME)_filter
$(INPUT_LINES)
TEST @TCL("AS_remove_empty_attributes $(OBSCURE_PARAM_LOOKUP)") == "0"
OUTPUT PASSED FEATURE_TYPE $(OUTPUT_OUTPUT_FTYPE)