Learning Objectives

After completing this unit, you’ll be able to:

Resources

Video

Automate Your Use of FME Server

Fatima tells Frank that she would like to receive an email with an Excel report of all the food vendors once a month. Frank offers to use FME Server Automations to create that workflow for her.

Automations takes data integration to the next level. Designing your FME workspaces with this in mind lets you create reusable, modular, and integrated applications for your organization, rather than one-off, single-use workspaces for every workflow. Automations support automated schedules and event-driven workflows that can:

Automations let you implement the enterprise integration patterns popularized by Gregor Hohpe and Bobby Woolf: repeatable solutions to commonly occurring problems encountered when integrating applications or systems.

Create an Automation Triggered on a Schedule

Frank needs to create a new Automation to run his self-serve workspace once a month and send the results as an Excel file to Fatima.

He logs into FME Server and clicks Automations > Build Automation in the web interface menu on the left side of the window.

Selecting Build Automation from the FME Server menu

Because he has built Automations before, he clicks Close when the Get Started window appears.

Automations Get Started tutorial

Frank knows all Automations are composed of three objects:

A green Trigger is already on the canvas. He double-clicks the Trigger to open the Trigger Details pane.

Opening the parameters for a Trigger

He clicks the Trigger drop-down and scrolls down to select Schedule Initiated.

Selecting a trigger event

Note

You can trigger Automations from a variety of sources, including cloud services, email, file directories, or webhooks.

Learn More

Frank notes that FME Server Schedules are representative of the time zone where FME Server was installed. He sets up a Schedule with the Start date as the last day of the current month and Recurrence as Last day of every monthSetting a Schedule

He clicks Apply and the Trigger changes to a Schedule to show it’s been set.

Viewing Schedule on canvas

Then he clicks Menu > Save As.

Saving an Automation

He names the Automation “Monthly Food Vendor Update” and clicks OK.

Naming an Automation

Run a Workspace in Response to a Trigger

Now that he’s set a Trigger, he needs to add an Action that will occur when the trigger is activated.

He clicks on the empty circle icon above Next Action to open the Next Action Details pane. Then he selects Run a Workspace from the drop-down options.

Creating an action

Selecting the action type

Note

Other Actions include:

  • Merge Messages lets you combine the results of previous actions, such as the results from two separate workspaces.
  • Filter lets you conduct tests from previous triggers or actions to control how your Automation runs. It’s like a Tester transformer for Automations.
  • Log lets you add to the Automations logs for workflow reporting and debugging.

Learn More

He will set the Automation to run the self-serve workspace. He clicks Repository and chooses Self-Serve, then for Workspace chooses CommunityMapping.fmw.

Next, he fills in the Parameters, choosing "Excel" for the Output Format and selecting "FoodVendors" from Feature Types to Read. With the Parameters filled in, he clicks Apply.

Setting the run a workspace action parameters

After clicking Apply, two new options appear on the canvas: a Next Action option for each port of the CommunityMapping.fmw workspace. The ✔ (check) port action will occur if the workspace runs successfully, and the X port action will occur if the workspace fails. These branching options let you create robust Automations that account for failure.

Viewing the run workspace action after it is set

Send an Email with the Results of a Workspace

Frank clicks the Next Action option coming out of the success port at the top and chooses Send an email for the Action. He fills in the email account information for his own company Gmail address, using the Gmail template provided via Load Template.

Note

If you are using Gmail or other email services requiring two-factor authentication, you will have to create an app password to allow FME Server access to your account. Use this instead of your normal password. For Gmail, see this tutorial. If you don't want to set that up, you can just read along.

A large number of External Actions are also available, including integration with APIs, Amazon Web Services, Azure, Dropbox, FTP, JMS, and Websockets.

Learn More

For the Email To parameter, he types in Fatima’s email address, and for Email From, he enters his. For Subject, she enters “Monthly Food Vendor Report”. For Email Body he enters:

“Hello Fatima,

Please find the most up-to-date Food Vendor data attached.

Best, Frank”

Finally, he needs to attach the data created by the workspace. For Attachment he enters the same path used for Output Location when the workspace runs, “$(FME_SHAREDRESOURCE_DATA)/CommunityMapping.zip”.

To test the email server connection, he clicks Validate. After a moment, an alert reporting the connection is Valid appears at the top of the pane. Seeing that it works, he clicks Apply.

His Automation is complete! He clicks the icon in the toolbar to save his Automation.

Automation Save button

Then he clicks Start Automation in the top-right corner of the window.

Start Automation button

The Automation starts. To test it (as it won’t run for a while), he clicks the clock icon on the Schedule trigger to open its parameters. There is a new button: Trigger. This button is available once an Automation is running and lets you test it by immediately running it once. He clicks Trigger to run the Automation once right now.

Trigger button

Fatima tells Frank she received an email: it worked. One less manual task for Fatima to do thanks to FME!

Note

This Automation is very tailored to Fatima’s workflow. Frank could improve it if Fatima’s needs change. For example, he could create a parameter that controls if all the data is written (the current behavior), or just the data updated in the last month. He could also create a User Key to pass the output location path to the Email action instead of manually entering it in two places. He could even start building the FME Automations writer directly into his workspaces, creating modular pieces that fit into enterprise integration patterns.

Learn More

Exercise

Create an Automation like Frank’s. 

If you wish, you can use your own email account for the Email External Action, using one of the provided templates if appropriate. Instead of sending the report to Marcie, send an email to an account you monitor. 

If you don't want to use email, you can simply use the Log a message Action instead. Use Menu > View Log File from the page with your running Automation to test if it's working.