Question

Directory Watch - Retrieve file name into an email

  • 14 February 2018
  • 8 replies
  • 3 views

Badge +8

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

Userlevel 5
Badge +30

Hi @philippeb ,

There is a interesting Tutorial Directory Watch.

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

Thanks,

Danilo

Badge +8

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.

 

 

 

Userlevel 5

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:

Badge +8

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

 

 

Userlevel 5
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.
Badge +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.

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

Userlevel 2
Badge +10

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.

Reply