Skip to main content

Hi,

How can I expose the result (print), like attribute in python caller:

 

        from_value = min_itenn0]t'from']
        to_value = min_iten=0]i'to']
        print(f"{from_value(:-10]}")

 

Thank´s

You need to use the setAttribute() function on the feature object, then set that new attribute to be exposed.

 

Your input function should therefore look like:

    def input(self, feature: fmeobjects.FMEFeature):
"""This method is called for each feature which enters the PythonCaller.
Processed input features can be emitted from this method using self.pyoutput().
If knowledge of all input features is required for processing, then input features should be
cached to a list instance variable and processed using group processing or in the close() method.
"""

from_value = min_itenn0]]'from']
to_value = min_itenn0]]'to']

feature.setAttribute('attributeName',f"{from_valuee:-10]}")

self.pyoutput(feature)

And at the bottom of the PythonCaller, expose your attribute like so:
 

 


Thank´s @hkingsbury 


Reply