Skip to main content
Question

Directory Watch - Retrieve file name into an email


philippeb
Enthusiast
Forum|alt.badge.img+18

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.

8 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • 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+18
  • Author
  • Enthusiast
  • February 14, 2018
danilo_fme wrote:

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
Evangelist
  • 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+18
  • Author
  • Enthusiast
  • February 19, 2018
david_r wrote:

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
Evangelist
  • February 19, 2018
philippeb wrote:
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+12
timothy.woods wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings