Skip to main content
13-Aquamarine
September 23, 2019
Solved

How to configure timer thing for monitoring changes on FileRepository?

  • September 23, 2019
  • 3 replies
  • 1360 views

What is the best way for configure timer which will check changes(like adding/updating/removing file) in my file repository and get info about created/updated/removed file(like name, date of changing etc.)

Best answer by PaiChung

There are a few ways to approach this.

1. There is a FileTransfer event, you can subscribe to that, this works when the Copy command is used.

2. There is a REST API (all thingworx content is automatically available as rest), so if you are making changes etc. You could chain a rest call to then execute processing of said changes.

3. A Timer, not too sure what exactly you are looking for, but if you use a timer, then you will need to go to the necessary repositories, retrieve the content details and somehow determine new, old, changed, removed etc. I don't think you will find a trail anywhere unless you create it yourself (store snapshots in a DataTable potentially)

 

3 replies

PaiChung22-Sapphire IAnswer
22-Sapphire I
September 23, 2019

There are a few ways to approach this.

1. There is a FileTransfer event, you can subscribe to that, this works when the Copy command is used.

2. There is a REST API (all thingworx content is automatically available as rest), so if you are making changes etc. You could chain a rest call to then execute processing of said changes.

3. A Timer, not too sure what exactly you are looking for, but if you use a timer, then you will need to go to the necessary repositories, retrieve the content details and somehow determine new, old, changed, removed etc. I don't think you will find a trail anywhere unless you create it yourself (store snapshots in a DataTable potentially)

 

and113-AquamarineAuthor
13-Aquamarine
September 24, 2019

Actually FileTransfer event not triggered every time when we upload files, so I choose the solution, when we monitoring directories using timer and FileRepository services

22-Sapphire I
September 24, 2019

Right, that means you will have to do a bit of extra work.

Again you could consider the REST API call to trigger the necessary services if you have that ability from the places you are sending the files from.