Is it possible and how would I do that?
Extract from where? The message normally appears in the log file.
Extract from where? The message normally appears in the log file.
@david_r I believe the message from transformer:
@david_r
Â
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.
Â
Â
@david_r
Â
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: '"
def log_callback(severity, message):
  Â  global TERMINATOR_MESSAGE
  Â  pos = message.find(terminator_prefix)
  Â  if pos > -1 and 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?
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: '"
def log_callback(severity, message):
  Â  global TERMINATOR_MESSAGE
  Â  pos = message.find(terminator_prefix)
  Â  if pos > -1 and 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?
@david_r
Â
Thanks, for the sample.
I was trying to directly access the message in the workbench and mail to in case of bad results.
Seems I still have to post process my log file as usual.
Â
Would be nice to have an output port on the terminator like the logger. So ne can embed it in between those scripts with 2 callers.
Â
Basically it seems I cant do what I had in mind, yes?
Â
Hi @NatalieAtSafe, any news regarding the semi-random "Â" characters in code blocks?
Not yet, sorry.
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.
@david_r
Â
Thanks, for the sample.
I was trying to directly access the message in the workbench and mail to in case of bad results.
Seems I still have to post process my log file as usual.
Â
Would be nice to have an output port on the terminator like the logger. So ne can embed it in between those scripts with 2 callers.
Â
Basically it seems I cant do what I had in mind, yes?
Â
You could do what @Mark2AtSafe suggested and embed it into a custom "gioTerminator" transfomer.
@david_r, @Mark2AtSafe and all others.
Â
Tx for the answers.
I don't know about the "gio terminator" though...sounds dangerous to me..;0
Â
Yes, ill simply use a creator to create a message and e-mail it (usually we do that trough batches). So I probably won't be using the terminator.
Â
Â
Greetz.