Question

Message or Alert Box

  • 19 September 2013
  • 9 replies
  • 27 views

Badge
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

9 replies

Userlevel 4
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
Userlevel 3
Badge +13
Hi,

 

 

How about twitting it? :)
Badge
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
Userlevel 3
Badge +13
You could try to use the system caller to make a sound......
Userlevel 3
Badge +26
I would insert an Inspector from the unreference port.
Userlevel 2
Badge +17
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

 

Userlevel 2
Badge +17
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
Userlevel 4
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

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!

Reply