Skip to main content
Question

Message or Alert Box

  • September 19, 2013
  • 9 replies
  • 345 views

larryw
Contributor
Forum|alt.badge.img
I have a simple workbench that does a FeatureMerger, and I would like to get the attention of the user for unreferenced Suppliers.  Is there any dialog that can be opened as part of a workbench?  

 

 

My workaround will be to write the unreferenced features out to a TX file and launch Notepad with the file using SystemCaller.  Just looking to see if there is something different...

 

 

Thanks,

 

Larry
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.

9 replies

david_r
Celebrity
  • September 19, 2013
Hi,

 

 

I don't think this is possible. However, I usually insert a Terminator into the workspace to catch any anomalies in the data. An example would be the UNFILTERED or NOT_MERGED ports, if that would indicate a problem with the data.

 

 

You can customize the error message from the Terminator that appears in the log.

 

 

David

fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • September 19, 2013
Hi,

 

 

How about twitting it? :)

larryw
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • September 19, 2013
Thanks,  unfortunately Twitter is blocked by our firewall.  I need a more in your face notification than a message in the log.  I will do my Notepad work around...

 

 

Larry

fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • September 19, 2013
You could try to use the system caller to make a sound......

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • September 19, 2013
I would insert an Inspector from the unreference port.

takashi
Celebrity
  • September 20, 2013
Hi,

 

 

It's possible to create an FME dialog box based on a temporary file defining FME GUI Directives, using a PythonCaller.

 

-----

 

# Example: Show a message dialog box import fmeobjects   def processFeature(feature):     msg = str(feature.getAttribute('message'))     directives = ['GUI TITLE Message',                   'GUI MESSAGE %s' % msg]     try:         # create a temporary file defining GUI directives.         filename = './fmeguidirectives.tmp'         file = open(filename, 'w')         for d in directives:             file.write(d + '\\n')         file.close()                  # create and show FME parameter prompt dialog box.         dlg = fmeobjects.FMEDialog()         if dlg.parameterPrompt(filename):             # Do something when OK button was clicked.             pass         else:             # Do something when Cancel button was clicked.             pass     except:         # if an error occurred, log the message.         logger = fmeobjects.FMELogFile()         logger.logMessageString(msg, fmeobjects.FME_WARN) -----

 

  FME GUI Directives http://fmepedia.safe.com/articles/FAQ/FME-GUI-Directives#heading_toc_j_13

 

 

If the message can be a unicode instance, see this Q&A: PythonCaller: Use logMessageString Problems with Encoding  https://safe.secure.force.com/AnswersQuestionDetail?id=906a0000000coj6AAA

 

Takashi

 


takashi
Celebrity
  • September 20, 2013
Tips: If your platform is Windows, you can also play a Windows sound.

 

-----

 

import winsound

 

          # Play a Windows sound before showing the dialog box.

 

        winsound.PlaySound('SystemAsterisk', winsound.SND_ASYNC)

 

-----

 

See more information about the winsound module:

 

35.4. winsound — Sound-playing interface for Windows

 

http://www.python.org/doc//current/library/winsound.html

david_r
Celebrity
  • September 20, 2013
Of if you really want to get fancy, use either the win32 API module or the Qt module to get access to a almost limitless amount of dialogs, forms, etc.

 

 

David

  • June 30, 2015

Hello, 

 

 

Is it possible to create a Dialog Box with the log information ? 

Also, I tried to filter the log information (in Tools > FME Options > Runtime) but it didn't do anything. It didn't filter anything in the Workspace, nor in the log textfile. Do you know why ?

 

 

Thanks!