The custom transformer contains a PythonCaller with the following code:
import fmeobjects class FeatureProcessor(object): def __init__(self): self.featureList = [] def input(self,feature): self.featureList.append(feature) def close(self): logger = open(FME_MacroValues['Summarylog'], "a") message = FME_MacroValues['Message'] + str(len(self.featureList)) + '\\n' logger.write (message) logger.close()
I want to use the logger multiple times, so I created a published parameter 'Message' in the custom transformer, so I can submit the text logged to each instance of the transformer.
When I'm running this I get the following error: Python Exception <KeyError>: 'Message'
It seems like the PythonCaller can't access the parameter defined in the custom transformer. It can access parameters in the Main (eg. 'Summarylog')
Any idea what the problem is here?