Skip to main content
Archived

Prompt message or dialog box

Related products:Transformers
  • July 11, 2018
  • 1 reply
  • 14 views

There should be a way to have a dialog box appear in the workspace to notify the user about the output of the transformer. There is the logger transformer, but the message supplied only appears in the translation log. It would be helpful if you could run the workflow and get feedback that could then lead to alternative workflows depending on the output

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.

1 reply

jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • July 11, 2018

While not generally considered best practice, and must not be used for FME Server, you could use the ctypes.windll library in a python caller

import ctypes def processFeature(feature): msg = "This is the message that appears" title = "This is the title of the message box" x = ctypes.windll.user32.MessageBoxA(0, msg, title, 1) feature.setAttribute("Response",x)

 

In this example, pressing the okay button returns a value of 1, and cancel a value of 2. There are several different message box available via windows, and quite a few settings for them.

 

You could look into https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-messagebox is you want more details.