Files
-
- 200 KB
- Download
Introduction
While the FMEFlowNotifier is very useful while a workspace is running, users often need to have something happen when a workspace completes - run another workspace, upload a file to S3, send an email, etc. This is where the web services come into play.
Video
Notifying success or failure of a job
When publishing a workspace from FME Workbench to FME Flow, the final step is selecting which web service to register with the workspace. In the registration properties, you can specify a topic to notify on the successful completion of the workspace, or on workspace failure. Data Download, Data Streaming, Job Submitter, and Notification services all have this option.
You must specify notification topics for each service you will use to run the workspace. For example, if you are running the workspace via the web interface and in response to incoming emails, you will need to configure both the Job Submitter Service and the Notification Service.
This tutorial will use an earlier workspace in which the FMEFlowNotifier transformer has been removed. In its place, we will use a Text File writer, and then modify our workspace’s job submitter properties as we publish it to FME Flow.
1) Add a new Text File writer named "notifier" to the canvas, and connect it to the JSONTemplater transformer.
2) Expand the attributes for the Text File writer, and connect the "_result" attribute from the JSONTemplater to the "text_line_data" attribute on the writer. Here is the completed workspace:
3) Publish the workspace to FME Flow. When you get to the Register Services dialog, select the "Edit" button to open the Job Submitter service properties.
4) Set the Job Submitter service properties as below:
5) If the Post to Topics don't exist, you can create them right in the publication wizard:
6) Configure an email subscriber that is subscribed to SAMPLE_SUCCESS_TOPIC.
7) Configure an email subscriber who is subscribed to SAMPLE_FAIL_TOPIC.
8) Run the newly published workspace and check for a notification sent to SAMPLE_SUCCESS_TOPIC when the job completes successfully.
9) Test for fail conditions by providing an invalid dataset, which will generate a failure notification sent to SAMPLE_FAIL_TOPIC.