Question

Python based transformer with multiple INPUT tags fails

  • 8 October 2016
  • 5 replies
  • 2 views

Badge

Hi,

I'm reopening the issue in the below post, as it seems that there may be a bug involved:

 

It seems that when I use an input tag like this: INPUT_TAGS: INPUT1 INPUT2

and a template with: $(INPUT_LINES) for both (it works, generating two factory input tags),

FME translates this into a Python factory definition with these input tags:

INPUT INPUT1 FEATURE_TYPE AttributeCreator_OUTPUT

 

INPUT INPUT2 FEATURE_TYPE AttributeCreator_2_OUTPUT

The problem as I see it, is that this syntax is illegal, hence a bug.

The factory documentation states that it must look like:

Syntax

 

 

FACTORY_DEF <ReaderKeyword> PythonFactory

 

[FACTORY_NAME <factory name>]

 

[INPUT FEATURE_TYPE <feature type>

 

[<attribute name> <attribute value>]*

 

[<feature function>]*]*

 

SYMBOL_NAME <python symbol name>

 

[SOURCE_CODE <source code>]

 

[PYTHON_NAMESPACE FMEOBJECTS]

 

[OUTPUT PYOUTPUT FEATURE_TYPE <feature type>

 

[<attribute name> <attribute value>]*

 

[<feature function>]*]*

I.e.. nothing between "INPUT" and "FEATURE_TYPE", which explains the error messages I'm getting:

The input tag 'INPUT1' in 'FACTORY_DEF .....' is not a valid input tag for this factory

Is the documentation in error, or is there a bug in the automatic translation. Please advise.

Thanks.

 

Lars I.

5 replies

Badge
Here's the full FMX file.crossjoiner.fmx

 

 

Badge
The previous question

 

 

Badge

Hi again,

Just to test my bug hypothesis, I replaced the $(INPUT_LINES) with an edited version of the input tags in the auto-translated factory definition:

INPUT FEATURE_TYPE AttributeCreator_OUTPUT

 

INPUT FEATURE_TYPE AttributeCreator_2_OUTPUT

And now it works, and my transformer receives the two input features, and outputs them again (unaltered sofar).

But I have my transformer logging the feature type of the input features (i.e. FMEFeature attribute "fme_feature_type"), but they report "Creator" and "Creator_2", which are how the features are initially created in my test workspace.

How does this mismatch (e.g. between feature type "Creator" and tag "AttributeCreator_OUTPUT") work ??

Thanks

 

Lars I.
Badge

Hi again,

Just to test my bug hypothesis, I replaced the $(INPUT_LINES) with an edited version of the input tags in the auto-translated factory definition:

INPUT FEATURE_TYPE AttributeCreator_OUTPUT

 

INPUT FEATURE_TYPE AttributeCreator_2_OUTPUT

And now it works, and my transformer receives the two input features, and outputs them again (unaltered sofar).

But I have my transformer logging the feature type of the input features (i.e. FMEFeature attribute "fme_feature_type"), but they report "Creator" and "Creator_2", which are how the features are initially created in my test workspace.

How does this mismatch (e.g. between feature type "Creator" and tag "AttributeCreator_OUTPUT") work ??

Thanks

 

Lars I.
Here's a screenshot of my test workspace:

 

2016-10-08-14-55-41-test-crossjoiner-c-users-gispr.png

 

Badge

Hi again,

Just to test my bug hypothesis, I replaced the $(INPUT_LINES) with an edited version of the input tags in the auto-translated factory definition:

INPUT FEATURE_TYPE AttributeCreator_OUTPUT

 

INPUT FEATURE_TYPE AttributeCreator_2_OUTPUT

And now it works, and my transformer receives the two input features, and outputs them again (unaltered sofar).

But I have my transformer logging the feature type of the input features (i.e. FMEFeature attribute "fme_feature_type"), but they report "Creator" and "Creator_2", which are how the features are initially created in my test workspace.

How does this mismatch (e.g. between feature type "Creator" and tag "AttributeCreator_OUTPUT") work ??

Thanks

 

Lars I.
Ah, the FMEFeature method "getFeatureType()" returns another value, and this corresponds with the factory feature type tag names. That puzzle's solved then :-)

 

Reply