Skip to main content
Question

Directory Watch - Retrieve file name into an email

  • February 14, 2018
  • 8 replies
  • 32 views

philippeb
Enthusiast
Forum|alt.badge.img+22

Hello!

Is it possible to get the new file name created (or modified or deleted) by the directory watch and send it into an email via subscriptions?

If not, how can I send the new file name detected?

Thanks.

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.

8 replies

danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Celebrity
  • February 14, 2018

Hi @philippeb ,

There is a interesting Tutorial Directory Watch.

You can filter in your Workspace the attribute dirwatch_publisher_action by CREATE.

Thanks,

Danilo


philippeb
Enthusiast
Forum|alt.badge.img+22
  • Author
  • Enthusiast
  • February 14, 2018

Hi @philippeb ,

There is a interesting Tutorial Directory Watch.

You can filter in your Workspace the attribute dirwatch_publisher_action by CREATE.

Thanks,

Danilo

Well, I don't have a workspace, so if I can retrieve the file name without one, I would be happy.

 

Do you know if I can use the information from the topic's JSON directly into my subscription (email). Like the dirwatch_publisher_path?

 

If it's necessary I create a workspace for this though, I'll do it.

 

 

 


david_r
Celebrity
  • February 15, 2018

Yes, it's possible, although the info is a bit rudimentary without further processing. Create a directory watcher publisher and connect it to a topic. Create an email subscriber and connect it to the same topic.

In the email template field, you can reference the JSON keys generated by the directory watcher publisher, e.g.

If you're not certain which keys are available, use the topic monitor and inspect the JSON that pops up whenever your directory watcher kicks in.

Here's the mail I received after having deleted a file in the monitored folder:


philippeb
Enthusiast
Forum|alt.badge.img+22
  • Author
  • Enthusiast
  • February 19, 2018

Yes, it's possible, although the info is a bit rudimentary without further processing. Create a directory watcher publisher and connect it to a topic. Create an email subscriber and connect it to the same topic.

In the email template field, you can reference the JSON keys generated by the directory watcher publisher, e.g.

If you're not certain which keys are available, use the topic monitor and inspect the JSON that pops up whenever your directory watcher kicks in.

Here's the mail I received after having deleted a file in the monitored folder:

Do you know if a JSON or text file is saved somwhere with this information in it? If yes do you know where?

 

I've checked the tutoriel video about FME Server but they use a readme.txt file at the root of the tutoriel's folder...

 

 


david_r
Celebrity
  • February 19, 2018
Do you know if a JSON or text file is saved somwhere with this information in it? If yes do you know where?

 

I've checked the tutoriel video about FME Server but they use a readme.txt file at the root of the tutoriel's folder...

 

 

Yes, the JSON is saved to a temporary folder, but I'm not sure how easy it is to locate. Look in the $(FME_SHAREDRESOURCE_TEMP) folder, it's probably in some temporay subdirectory with a random name.

Forum|alt.badge.img+2

If you turn on topic monitoring and watch, you should be able to see the json containing the directory watch info. In workbench, there are some server parameters FME_TOPIC_MESSAGE which tells you where the json is stored. You can then read it in and construct your email.


timothy.woods
Contributor
Forum|alt.badge.img

I tried to access the above link for Tutorial and the link is broken.


danminneyatsaf
Safer
Forum|alt.badge.img+13

I tried to access the above link for Tutorial and the link is broken.

@timothy.woods​ The article was re-located to a new link, which you can find here: https://community.safe.com/s/article/directory-watch-publisher-tutorial-2017

This is a legacy article now, so if you're using FME Server 2019+, please refer to Run a Workspace When Data Arrives in a Directory.