fmeobjects.FMEFactoryPipeline

Inheritance diagram of fmeobjects.FMEFactoryPipeline

FMEFactoryPipeline.addFactories(factoryDefFile)

This method is used to add a set of factories to the end of the factory pipeline.

FMEFactoryPipeline.addFactory(factoryDef, ...)

This method is used to add a new factory to the end of the factory pipeline.

FMEFactoryPipeline.allDone()

This method is used to indicate that no more features will be entering the pipeline.

FMEFactoryPipeline.configureFunction(...)

This method is used to specify configuration lines for functions such as @Lookup, @Relate, and @Sql, which require configuration information to operate.

FMEFactoryPipeline.getErrorMessage()

If allDone() returns an error, the whole message produced can be retrieved with this method.

FMEFactoryPipeline.getOutputFeature()

This method is used to fetch a feature ready for output from the pipeline.

FMEFactoryPipeline.processFeature

processFeature(feature),

FMEFactoryPipeline.setCallback

setCallback(function),

class FMEFactoryPipeline

FME Factory Pipeline Class

Creates a new factory pipeline object.

init(name)

Constructs a factory pipeline object.

Parameters:

name (str) – The name of the factory pipeline.

Return type:

FMEFactoryPipeline

Returns:

This method returns a new factory pipeline object.

init(name, directives)

Constructs a factory pipeline object.

Parameters:
  • name (str) – The name of the factory pipeline.

  • directives

    Additional directives to specify. Directives are of the form of a directive name as an entry in the list, with the next entry having the value for the directive. An empty list of str can be used to specify that no directives are present. The supported directives are :

    • <–macro_name> Any directive that begins with two dashes is considered to be a macro name that will be set for use within the pipeline. For example, if a directive name ‘–MySetting’ with a value of ‘Yes’ is given, then the macro ‘MySetting’ will be given a value of ‘Yes’, for use within the pipeline.

Return type:

FMEFactoryPipeline

Returns:

This method returns a new factory pipeline object.

__init__(*args, **kwargs)
addFactories(factoryDefFile)

This method is used to add a set of factories to the end of the factory pipeline. If unsuccessful, this method throws an exception.

Parameters:

factoryDefFile (str) – Specifies the name of a file containing the factory definitions.

Return type:

None

Raises:

FMEException – An FMEException is raised if there was an error.

addFactory(factoryDef, delimiter)

This method is used to add a new factory to the end of the factory pipeline. If ‘factoryDef’ is a list of str the factory to be added is specified as a set of tokens; one token for every whitespace-delimited str in the factory definition. Each token is represented as one entry in the ‘factoryDef’ parameter. For example, the PolygonFactory show below is be specified using 20 tokens:

  • FACTORY_DEF * PolygonFactory

  • FACTORY_NAME SamplePolygon

  • INPUT FEATURE_TYPE *

  • GROUP_BY someAttr

  • VERTEX_NODED

  • REMOVE_CORRIDORS

  • OUTPUT POLYGON FEATURE_TYPE poly

  • OUTPUT LINE FEATURE_TYPE line

If ‘factoryDef’ is a str, it specifies the factory to be added as an ASCII character str. The ‘delimiter’ parameter specifies the str to be used as delimiter when parsing the ‘factoryDef’ string for tokens.

Parameters:
  • factoryDef (list[str] or str) – Specifies the factory definition to be added.

  • delimiter ((Optional) str) – Only to be specified if ‘factoryDef’ is a str, defaults to “ “ or space delimited.

Return type:

None

Raises:

FMEException – An FMEException is raised if there was an error.

allDone()

This method is used to indicate that no more features will be entering the pipeline. Any factories in the pipeline that are still holding features will release them when this method is called. This method can only be called once on per pipeline.

Return type:

None

Raises:

FMEException – An FMEException is raised if there was an error.

configureFunction(functionConfig)

This method is used to specify configuration lines for functions such as @Lookup, @Relate, and @Sql, which require configuration information to operate. Refer to the FME Functions and Factories manual for detailed information.

Parameters:

functionConfig (list[str]) – The configuration information for a function.

Return type:

None

Raises:

FMEException – An FMEException is raised if there was an error.

getErrorMessage()

If allDone() returns an error, the whole message produced can be retrieved with this method.

Return type:

str

Returns:

The error message from allDone().

getOutputFeature()

This method is used to fetch a feature ready for output from the pipeline. If no feature is ready for output, an exception is thrown. This method should not be used if the setCallback() method has been called on the pipeline.

Return type:

FMEFeature or None

Returns:

The feature ready for output or None if all the features have been outputted.

Raises:

FMEException – An FMEException is raised if there was an error.

processFeature()

processFeature(feature),

This method is used to insert a feature into the pipeline for processing. On output the feature is returned void of all attributes and geometry.

Parameters:

feature (FMEFeature) – The feature to insert into the pipeline.

Return type:

None

Raises:

FMEException – An FMEException is raised if there was an error.

setCallback()

setCallback(function),

This method is used to specify the name of a function that will be called by the pipeline when a feature is ready for output. If a callback function is specified, features must not be retrieved using the getOutputFeature() method.

Parameters:

function (Callable) – The function to provide FME for use as a callback function. The passed in function must take in a FMEFeature as the parameter and return True on success, and False upon failure.

Return type:

None

Raises:

FMEException – An FMEException is raised if there was an error.