Exercise 5 Building Updates Notification System
Data Building footprints (Esri Shapefile)
Overall Goal Provide email-driven notifications for updates
Demonstrates Email subscriptions
Start Workspace RealTime-Ex5-Begin.fmw
End Workspace RealTime-Ex5-Complete.fmw

After configuring FME Server to process building footprints updates with both the Directory Watch and Email Publications, your supervisor is wondering if they can receive an email whenever the corporate database is updated.

Using an external email server, you think that it is possible to configure another Notification in FME Server to satisfy this requirement.


Miss Vector says...
This exercise continues where Exercise 4 left off. You must have completed Exercise 4 to carry out this exercise.
Access to an SMTP Email Server is required for sending email in this exercise. Gmail, Outlook, and Yahoo! are examples acceptable web-based solutions if you do not have access to an internal email server.


1) Add Subscription
Open the FME Server web interface and navigate to the Notifications page. Click the Subscriptions tab and then click New to create a new Subscription. This will be an email service through which a response will be sent.

Give the subscription a name like Send Building Update Email and create a new topic for it such as BuildingUpdateEmail (it's important to use a different topic than from the previous exercises).

Set the protocol to Email and set up your SMTP email server parameters.

In case it is of use, the server information for Gmail is as follows:

SMTP Server Host smtp.gmail.com
Server Port 465
Connection Security SSL/TLS

Regardless of the email provider, you should set these parameters as follows:

Email From Your account name (for example [email protected])
Email Subject Building Footprints Database Updated

Most of the general settings (Email To, Email Template, etc.) will be set by the content we are going to provide, so once the above is set, click OK to save the Subscription.


2) Edit Workspace
Open the workspace from Exercise 4 (or the Start Workspace listed above).

Add two new transformers - the FMEServerEmailGenerator (a custom transformer) and an FMEServerNotifier - as a separate stream of data, connected to the Output Port of the FeatureReader:

NB: It's important to connect these two transformers to the <Initiator> port of the FeatureReader, where only one feature will emerge. If you connect them to the <Generic> output port then you will get an email for every feature in the Shapefile dataset!


3) Edit FMEServerEmailGenerator
Inspect the parameters for the FMEServerEmailGenerator. This transformer can be used to override the configurations in the Email Subscription created in Step 1.

Each field can also accept attributes allowing the email to be dynamically configured. For our purposes in the training course, set the following parameters manually:

To (An email you have access to check)
Subject Building Footprints Database Updated
Content The Building Footprints database has been updated!


4) Edit FMEServerNotifier
Now edit the parameters for the FMEServerNotifier transformer.

Set FME Server Connection parameters, pick the Topic created earlier (BuildingUpdateEmail), and for the Content select the attribute text_line_data (this attribute is created by the FMEServerEmailGenerator):


5) Publish Workspace
Save and publish the workspace.

If the workspace name is different to that used in the Exercise 4 workspace, an update will need to be made as follows.

Navigate to the FME Workspace Subscriptions page. Notice that a Subscription will have been automatically created when registering the workspace with the Notification Service in the previous exercise. For example, if the workspace was called RealTime4, the Subscription name will be something like admin.Training.RealTime4:

Click on this notification to change its parameters, and set/ensure that the Workspace parameter is pointing to the workspace just published.


6) Test Workspace
Test the workspace by sending an email to the Publication email address. Be sure to attach a zip file of the Shapefile datasets (.dbf, .prj, .shp, .shx) from C:\FMEData2017\Data\Engineering\BuildingFootprints to the email.

If the workflow was successful, you should receive an email back with a response!


CONGRATULATIONS
By completing this exercise you have learned how to:
  • Set up an outgoing Email Subscription
  • Trigger an Email Subscription through the FMEServerNotifier transformer

results matching ""

    No results matching ""