Skip to main content
Question

Send messages to terminal when batch processing from command line

  • August 16, 2016
  • 2 replies
  • 25 views

annetdeboer
Forum|alt.badge.img

Hi all,

We're batch processing a lot of sqlplus commands and FME Workspaces (with parameters). However, the FME Workspaces only say "failed" or "success" and I would like them to talk more ;-)

Like reporting "1034 records written"

Is there a way to send a message from the workspace to the terminal / dos prompt?

It doesn't have to be a customized message per se, it could also be a relevant portion of the log (only the part where it displays the amount of records read/written?).

Best wishes, Annet

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • August 16, 2016

You can use the Python shutdown script for this. Example:

import fme
if fme.status:
    print "%s records written" % fme.totalFeaturesWritten
else:
    print "Workspace FAILED"

This works because Python print statements goes to STDOUT by default, which would be the command window when FME is invoked from the command line. If the workspace is executed from within FME Workbench, the print statements will be sent to the log window.

Documentation for the fme module function variables: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Configuration/FME_END_PYTHON.htm


annetdeboer
Forum|alt.badge.img
  • Author
  • August 16, 2016

You can use the Python shutdown script for this. Example:

import fme
if fme.status:
    print "%s records written" % fme.totalFeaturesWritten
else:
    print "Workspace FAILED"

This works because Python print statements goes to STDOUT by default, which would be the command window when FME is invoked from the command line. If the workspace is executed from within FME Workbench, the print statements will be sent to the log window.

Documentation for the fme module function variables: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Configuration/FME_END_PYTHON.htm

Works like a charm! Thanks so much @david_r