Learning Objectives

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

Resources

Video

Publish a Workspace to the Web

Now that Frank has created a self-serve workspace, he needs to publish it to FME Server.

Note

The rest of this module assumes you have access to an FME Server. If you need help installing, licensing, and creating an account for FME Server, please follow these instructions. Options for accessing FME Server include:

  • Install FME Server on your own machine ( a free trial is available)
  • Access your organization’s Server
  • Use an instance provided by requesting an on-demand virtual machine in the footer link below

Preparing a Workspace to Publish to FME Server

Frank already has a workspace that is working well. However, Jennifer notices a problem that he needs to address before publishing to FME Server. She explains that creating the correct user parameters before publishing makes a much better experience for users running the workspace using FME Server.

The path for the output data in the workspace is currently hardcoded to “C:\FMEData2020\Output\Training\Training.xlsx”. Frank confirms this in the Navigator > Training [Generic] writer > Destination Generic (Any Format) Folder parameter. Having this hard coded is fine when he just runs it on his own machine. When he publishes a workspace to FME Server, the workspace will try to write data to the C:\ drive of the machine that is hosting FME Server. However, he can’t assume access to a C:\ drive: it could be restricted for security purposes, or if it’s a Linux machine it won’t even exist! Jennifer informs him it’s best practice to instead read and write data that exists in FME Server’s shared Resources folder.

To fix this, Frank double-clicks on the Destination Generic (Any Format) Folder parameter and enters “$(FME_SHAREDRESOURCE_DATA)\CommunityMapping.zip”. This path includes the “FME_SHAREDRESOURCE_DATA” user parameter (viewable under User Parameters > FME Server Parameters) and sets the workspace to write out its results to a ZIP file called CommunityMapping. When the workspace is published to FME Server, the data will be written out to the shared Data folder for all users to access. We’ll take advantage of that feature in a later unit.

Setting writer path to FME Server Shared Resources Data folder

Note

FME has many useful built-in parameters similar to FME_SHAREDRESOURCE_DATA that let you access information about FME itself, such as the FME build number used to run the workspace or the location of the temporary data folder on the machine running the workspace. These parameters can be used for customizing how FME runs in different environments or for creating customized reporting on workspace runs.

Learn More About FME Parameters

Learn More About FME Server Parameters

Note

All file- and folder-based FME formats can be read as or written to ZIP files. Simply provide a ZIP file for the Dataset parameter of your reader or add “.zip” into the Dataset file path of your writer.

Connect to FME Server with a Web Connection

Now that Frank’s prepared the workspace by creating the correct user parameters, he needs to create an FME Server web connection before he can publish. Jennifer walks him through the steps.

Note

Remember that database and web connections save authentication information to connect to databases, web services, and APIs. They are stored on the user’s operating system profile, so authentication information can be stored separately from the workspace. They can also be published to FME Server to allow multiple users to share them without exposing any passwords. The FME Server web connection works the same way as other web connections.

To create an FME Server web connection, Frank clicks the Publish to FME Server button in the Workbench toolbar.

Publish to FME Server

Because this is his first time connecting to FME Server, the Connection drop-down is red. He clicks the drop-down and chooses Add Web Connection…

Adding a web connection

Note

You can manage Database and Web Connections under Tools > FME Options from the Workbench menu bar if you are running a Windows machine, or FME Workbench > Preferences if you are running a Mac. You can also create them where they are needed, such as in a reader or transformer dialog.

The FME Server Connection dialog opens and he fills it out to connect to FME Server running on his own machine:

Filling in FME Server Connection parameters

Note

If you are attending a Safe Software training course, the password is FMElearnings.

Note

You can connect to your own organization’s FME Server if you have permission. Get the connection details from your FME Server Administrator. If you are using FME Server on your own machine, use http://localhost and your own username and password set during installation.

After filling out the dialog, Frank clicks Authenticate. FME Workbench tests the connection and then returns him to the Publish to FME Server dialog. He clicks Next.

Publish a Workspace to FME Server

Now that he’s set up a web connection, Frank can finish publishing his workspace. He renames it CommunityMapping.fmw by typing in the Workspace Name field.

Workspaces in FME Server are stored in repositories. To create a new repository for his workspace, Frank clicks New… and makes a new repository called “Self-Serve”. He clicks OK twice to finish creating his new repository.

Creating a new repository

Jennifer reminds Frank to consider how his workspace will access data after he publishes it to FME Server. Many workspaces use data stored locally on the author’s computer, such as C:\FMEData2020\Data. However, FME Server is usually run on a different machine that doesn’t have access to that directory. Therefore, data used in workspaces published to FME Server should also be added to FME Server.

To accomplish this, Frank clicks the Select Files… button.

Selecting files to upload

This action opens the Select Files to Upload dialog, which Frank sees he can use to add the geodatabase to the shared Data folder in FME Server. Frank does this by clicking the Select Location… button, then choosing the Upload to a shared resource folder option. Finally, he clicks the Data folder to select it and then presses OK.

Selecting data upload location

Uploading to a shared resource folder

He’s indicated where he wants to upload the data but now has to confirm which datasets to upload. He does this by checking the geodatabase.

Selecting files to upload

With a destination for the geodatabase on FME Server selected, he clicks OK and then Next.

Note

Frank could have published his data directly to the Self-Serve repository, but that comes with a number of challenges. See the Manage FME Server Data and Connections module for more information.

Before he can publish, Frank has to select service(s) for his workspace to use.

Note

An FME Server service is an interface for interacting with FME Server.

Learn More

Frank has to choose services to control how users receive the data when they run the workspace on FME Server. These services each provide a different way to interact with the workspace:

Frank makes sure both the Data Download and Job Submitter services are checked. With these checked, anyone can run the workspace and receive a ZIP file of the results. Then he clicks Publish.

Selecting services to use with published workspace

Frank’s workspace and data are now available in FME Server.

Note

Most of these actions (uploading data, controlling services, and running workspaces) can also be controlled using the FME Server REST API. The one exception is publishing workspaces, which must be done through FME Workbench.

View a Published Workspace

Frank can access his workspace in a web browser using the Direct Link provided in the Translation Log: http://localhost/fmeserver/#/workspaces/run/Self-Serve/CommunityMapping.fmw.

Viewing workspace Direct Link in Translation Log

He clicks the link to open FME Server. This link directs Frank to the Run Workspace page. Here he can choose which workspace to run, which service to use, optionally provide an email to send the results to, and set the published parameters. Here he sees why published parameters are important - creating them in FME Workbench allows him to customize the experience for users running his workspace on the web.

Running workspace

Exercise

Make sure you have followed along with Frank’s steps.