In this tutorial we will demonstrate how to use FME server’s directory watch publisher protocol.
Let's begin by logging into the FME server web user interface.
Our first step will be to create a new directory for our input and output folder.
Go to resources, then click on the temp resource and then click on the new folder button.
Name the newly created folder to convert underscore tool.
Select the convert tool folder and create two new subfolders named input and output.
Next we will create the directory watch publication, go to notifications and select the publication's
tab, then click new.
Create a new publication named convert underscore tool.
Select directory watch as the protocol.
For topics to publish to enter the new topic Convert underscore tool.
For the directory to watch, browse resources and select the input folder.
We are only interested in monitoring create operations, so we can remove the modify and
delete operations.
Finally set the poll interval to one minute.
Click OK to create the publication.
We can verify the directory watch publication by using topic monitoring.
Go to notifications then click on the topic monitoring tab.
Click on topics to monitor and select convert tool to start monitoring.
Remember to keep this browser tab or window open so the topic monitoring continues to
run.
In a new tab go to the temp folder on the resources page and upload two files to the
input directory we created.
For this demonstration we'll be uploading AutoCAD drawing files.
Wait one minute and then return to the monitoring page where you'll see two messages one for
each file that was uploaded.
Now we will extend our example that it makes use of a child workspace to convert data into
a shape format and upon completion the parent
workspace will copy the same files to an FMEserver resource directory.
Open the easy translator two child workspace in FME workbench, you will see that a generic
reader and generic writer have been placed on the canvas.
Publish the workspace to FME server, enter the connection parameters and publish the
workspace in the samples repository as a job submitter service.
Next open the convert.fmw parent workspace in FME workbench modify the FME server
job submitter transformer so that it's updated to your host information.
Select the Samples repository and the easy translator 2 workspace.
Click finish to close the transformer.
Publish the workspace to FME server at the register services screen select only the notification
service and uncheck the job submitter.
Configure the notification service by clicking edit and set the subscribe to topics to convert tool.
Now let's test to verify that our parent-child workspaces function as expected.
Return to the resources page and navigate to the temp convert
tool input directory, upload a drawing file to the input directory, wait one minute and
then go to the temp convert tool output directory.
Here you will see a newly created zip file.
download it and you will find two shapefiles inside.