Skip to main content

hi !

FME name machine parameter does it exist? I see the name of my computer at the beginning of the log but I don’t find where is this parameter.

Thanks !

You can use the EnvironmentVariableFetcher, using the environment variable COMPUTERNAME. You can also do this from PythonCreator or PythonCaller using the code below.

import fmeobjects,socket


class FeatureCreator(object):
"""Template Class Interface:
When using this class, make sure its name is set as the value of the 'Class
to Process Features' transformer parameter.
"""

def __init__(self):
"""Base constructor for class members."""
pass

def input(self, feature):
"""This method is called once by FME to create FME Feature(s).
A created Feature is emitted through the self.pyoutput() method.
Any number of Features can be created and emitted by this method.

:param fmeobjects.FMEFeature feature: Dummy FME Feature passed in by
FME. It can be ignored.
"""
newFeature = fmeobjects.FMEFeature()
newFeature.setAttribute('hostname',socket.gethostname())
self.pyoutput(newFeature)

def close(self):
"""This method is called at the end of the class."""
pass

 


Reply