I meant the message one sets in the terminator, can it be extracted?
The message appears when terminated. Can I acces it?
I tried some of your earlier sugestions and @takashi's log extractor python scripts , but can't get at the message from the terminator.
Sorry if my question wasn't clear enough: where would you like to access the error message from? The shutdown script? A PythonCaller? Some external program?
This will let you access the Terminator message in the shutdown script.
Copy the following into the startup script:
import fmeobjects
global TERMINATOR_MESSAGE
TERMINATOR_MESSAGE = None
terminator_prefix = "Termination Message: '"deflog_callback(severity, message):
  global TERMINATOR_MESSAGE
  pos = message.find(terminator_prefix)
  if pos > -1and severity > 1:
    TERMINATOR_MESSAGE = message[pos+len(terminator_prefix):-1]
fmeobjects.FMELogFile().setCallBack(log_callback)
This demonstrates how to test for the Terminator in the shutdown script:
global TERMINATOR_MESSAGE
if TERMINATOR_MESSAGE:
  print TERMINATOR_MESSAGE
else:
  print"All is well"
This will let you access the Terminator message in the shutdown script.
Copy the following into the startup script:
import fmeobjects
global TERMINATOR_MESSAGE
TERMINATOR_MESSAGE = None
terminator_prefix = "Termination Message: '"deflog_callback(severity, message):
  global TERMINATOR_MESSAGE
  pos = message.find(terminator_prefix)
  if pos > -1and severity > 1:
    TERMINATOR_MESSAGE = message[pos+len(terminator_prefix):-1]
fmeobjects.FMELogFile().setCallBack(log_callback)
This demonstrates how to test for the Terminator in the shutdown script:
global TERMINATOR_MESSAGE
if TERMINATOR_MESSAGE:
  print TERMINATOR_MESSAGE
else:
  print"All is well"
Does this help?
Hi @NatalieAtSafe, any news regarding the semi-random "Â" characters in code blocks?
What you could do is add an AttributeCreator/Emailer just before the Terminator. Set the message and send out an email before anything gets terminated. And then you don't need to even set the message in the Terminator - just use the attribute in which you defined the message.
The nice thing then is that you can copy the Terminator anywhere in a workspace, and it will work fine, provided you use the same attribute name throughout.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.