Skip to main content

I would like to write some messages to the Log, at the end of a successful Translation.

For example, the source schema & table name and the destination schema & table name

Is there a FME Transformer that can write a user parameter to the Log? With some surrounding text?

Easiest way is to use the Logger transformer, that allows you to log a custom message. Do keep in mind that that message is logged once per feature passing through.

 

Alternatively, a Python shutdown script, which will be executed after the processing.


I do not want to write a message for every single feature.

I just want to write a message to the log when the Translation is successfully finished.

By Python shutdown script, do you mean the PythonCaller?

And that I should use a Print statement here?

  def close(self):

    pass


No, it's in the Navigator:

Workspace Parameters -> Scripting -> Shutdown Python Script

 

There's a good knowledge base article that should help you on your way: https://community.safe.com/s/article/shutdown-python-scripts-in-fme


I can now successfully use the Shutdown Python Script to print a message to the Translation Log window

Now I need to figure out how to convert a Published Parameter into a string so that it can be printed.

User Parameters are;

sourceSchema

TableName

destSchema

But Print (sourceSchema) fails


I think I got it

import fme

sourceSchemaVal = "Source Schema : " + fme.macroValues['sourceSchema']

print (souceSchemaVal)


Reply