Hi @sui_huang,
Could you share your log file to analyze better?
Thanks,
Danilo
Try the following code in a PythonCaller, modify MAX_LENGTH as needed:
import fmeobjects
MAX_LENGTHÂ =Â 10
def AttributeLengthTrimmer(feature):
    for attr in feature.getAllAttributeNames():
        value = feature.getAttribute(attr)
        if value:
            feature.setAttribute(attr, str(value) :MAX_LENGTH])
Hi @sui_huang,
Could you share your log file to analyze better?
Thanks,
Danilo
Hi @danilo_inovacao
Â
unfortunately I cannot upload the log file because the information inside maybe confidential.
Â
Â
The lines before the logging of the huge feature in log file is as following, and they are triggered by the Terminator transformer.
Â
Â
2017-10-12 11:30:59| 13.8| 4.6|FATAL |The below feature caused the translation to be terminated
Â
2017-10-12 11:30:59| 13.8| 0.0|STATS |Storing feature(s) to FME feature store file `C:\\Desktop\\Report_log.ffs'
Â
2017-10-12 11:30:59| 13.8| 0.0|INFORM|+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Â
2017-10-12 11:30:59| 13.8| 0.0|INFORM|Feature Type: `AttributeCreator_OUTPUT'
Â
2017-10-12 11:30:59| 13.8| 0.0|INFORM|Attribute(encoded: utf-16) :.....
Â
Â
Try the following code in a PythonCaller, modify MAX_LENGTH as needed:
import fmeobjects
MAX_LENGTHÂ =Â 10
def AttributeLengthTrimmer(feature):
    for attr in feature.getAllAttributeNames():
        value = feature.getAttribute(attr)
        if value:
            feature.setAttribute(attr, str(value) :MAX_LENGTH])
Hi @david_r Instead of using Python script, I tried put an AttributeCreator in between and use "Left" string function inside to truncate the attribute. It works. It is the same idea as you proposed but more specific to my situation because I know which attribute is long.
Â
Thank you.
Â