Exercise 1 | Building Updates Notification System |
Data | Building footprints (Esri Shapefile) |
Overall Goal | Trigger notification for new files |
Demonstrates | Notification topics and Directory Watch publications |
Start Workspace | N/A |
End Workspace | N/A |
As a technical analyst in the GIS department you want to start experimenting with notifications in FME Server. The Directory Watch protocol seems like a good place to start, and you already were thinking about a shared folder where users place Shapefile datasets for adding to, or updating, the corporate database.
1) Create Resources Folder
The first step is to create a Resources folder to copy the data to. Open the FME Server web interface and navigate to the Resources page.
Browse to the Data folder and create a new subfolder called BuildingUpdates:
Miss Vector says... |
This exercise utilizes the FME Server Resource folders, but there is also native support in FME Server to watch for new resources in Amazon S3 Buckets, Dropbox, and FTP.
Using the same concepts described here, you could use one of these protocols instead of Directory Watch. |
2) Create Publication
Now to create a publication and topic that will be triggered by a new file. Navigate to the Notifications page, click the Publications tab, and then click the New button.
Enter "Incoming Building Footprints" as the new publication's name.
Next click in the text box besides Topics to Publish To. Type in ShapeIncomingFile and click on the entry with that name that appears in the drop-down list. This will create a new topic and assign it to this publication.
3) Set Publication Protocol
Now select Directory Watch from the drop-down list as the protocol for this publication. In the dialog that appears click the browse button for the Directory to Watch parameter and select the newly created resources folder:
Back in the publication definition, for the Filter parameter remove the MODIFY and DELETE actions. All we really want to monitor are new files arriving, not old ones being removed:
Change the Poll Interval to 1 Minute and click OK to create the new publication.
4) Monitor Topic
Click on the tab for Topics. The ShapeIncomingFile topic should now be listed in the list of topics. There is also a Topic Monitoring dialog to the upper-right of the page.
In the drop-down box for Topic Monitoring, select the ShapeIncomingFile topic and click the green "run" button. This will start Topic Monitoring:
5) Test Topic
Now let's test the topic. Locate the source Shapefile datasets in C:\FMEData2017\Data\Engineering\BuildingFootprints. Select a set of files (.dbf, .prj, .shp, .shx) for one dataset and create a compressed zip file out of them (right-click > Send to > Compressed (zipped) folder).
Now upload the zip file into the newly created Resources folder. There are two ways to do this.
You can use the file system (by copying the file to C:\ProgramData\Safe Software\FME Server\resources\data\BuildingUpdates) or use the FME Server web interface. If you use the web interface, open a new window or tab, so we can continue to monitor the ShapeIncomingFile topic.
Check back in the Topic Monitoring window and you will see that the topic has been triggered by the new file:
Miss Vector says... |
Remember, the Publication is set up to check the folder only once per minute - so if the Topic Monitoring doesn't immediately show a result, don't panic! Be patient and it will appear shortly. |
Now we know how the Directory Watch notification works! We will see in subsequent exercises how to process this information.
CONGRATULATIONS |
By completing this exercise you have learned how to:
|