fmeobjects.FMETransformer

Inheritance diagram of fmeobjects.FMETransformer

FMETransformer.getParsedParamValue

getParsedParamValue(paramName),

FMETransformer.isRequired

isRequired(parameterName),

FMETransformer.setParameterValue

setParameterValue(parameterName, parameterValue),

FMETransformer.setParameterValues

setParameterValues(parameters),

class FMETransformer

FME Transformer Class

This class provides the ability to parse transformer parameters.

init(transformerName, fmePackageName, transformerVersion)

Creates a transformer object of the specified name. The transformer name must be fully qualified with its package name if it has one.

Warning

Instantiating this class on FME Flow requires FME 2024.0 (build 24145) or newer.

Parameters:
  • transformerName (str) – The name of the transformer as specified by TRANSFORMER_NAME in the transformer’s definition.

  • fmePackageName (str) – (Optional) The FME package name of the transformer. If the transformer has a package name, including it greatly increases the performance of creating this transformer.

  • transformerVersion (int) – (Optional) The version of transformer definition to create. By default the latest version of the transformer is loaded.

Return type:

FMETransformer

Returns:

An instance of a Transformer object.

__init__(*args, **kwargs)
getParsedParamValue()

getParsedParamValue(paramName),

Returns parsed parameter value for the specified parameter name. If the parameter value was not set on the transformer, then the default value is returned.

If the parameter value set on the transformer cannot be scoped to the required parameter type, then a ValueError will be raised. In such a case, the caller should reference the parameter value they set on the transformer for the original parameter value.

Parameters:

paramName (str) – Parameter name of value to retrieve.

Return type:

bool, int, float, str, bytes, None, list[bool, int, float, str, bytes, None]

Returns:

The parsed parameter value.

Raises:
  • ValueError – Raised when the parameter value cannot be scoped to the required parameter type.

  • TypeError – Raised when the parameter value type is not supported.

  • KeyError – Raised when a parameter value does not exist for the parameter name.

isRequired()

isRequired(parameterName),

Will return True if parameter is required. False otherwise. If parameter is currently unused, False will be returned.

Parameters:

parameterName (str) – Name of parameter to check if required.

Return type:

bool

Returns:

If a parameter is required.

setParameterValue()

setParameterValue(parameterName, parameterValue),

This is to sets a parameter name and parameter value on the FMETransformer. There is no value validation. The incoming value is assumed to be correct.

Parameters:
Return type:

bool

Returns:

Will return False if the parameter value could not be set.

setParameterValues()

setParameterValues(parameters),

This is to set all the parameter names and specified parameter values on the FMETransformer. There is no value validation. All incoming values are assumed to be correct.

Parameters:

parameters (dict[str, bool | int | float | str | bytes | None | list[bool, int, float, str, bytes, None]]) – Parameter name/value pairs. None represents a null value.

Return type:

bool

Returns:

Will return False if a parameter value could not be set.