In the previous video in this series, we learned how to publish a workspace to FME Server and
run it from the web user interface.
In this video, we’ll modify that workspace so it allows for“self-serve” data access.
To accomplish this, we’ll perform the following: create published parameters in FME Workbench;
publish the workspace to FME Server; and run the workspace from the web user interface.
The workspace we have is pretty straight-forward, taking data from a file geodatabase and writing
it to the Generic format.
The Generic Writer is very flexible, and allows for the user to decide which format to write
to when the workspace runs.
Here we have set the default format to Esri Shapefile.
What we really want is for the user to select the format of their choice, from a small list,
at run time.
This is accomplished with published parameters.
Parameters in FME control how FME operates.
They exist in many places, such as readers, writers, and transformers.
Take a closer look at one of the parameters for the Generic Writer: Output Format.
Double-clicking on this parameter shows that it’s been set up so the user can select
from any format in the formats gallery.
But that’s not what we want.
The goal is to present the user with a list of 4 common formats.
We’ll need to create a new user parameter, and define it accordingly.
Right-click on the Published Parameters node and select Create User Parameter.
For Type, select Choice with Alias.
For Name, enter Output_Format.
For Prompt, enter Output Format:.
Click the button next to Configuration.
We’re going to Import the formats we want.
Click on Import, then Writer Formats.
Search and select Esri Shapefile, MapInfo TAB, GML, and Microstation Design V8.
Click OK, and OK again.
Select Esri Shapefile for the default value.
Note that Published is checked by default - when a user parameter is published, a user
is prompted for a value when the workspace runs.
Click OK.
All published parameters have a purple cogwheel.
Our new Output_Format parameter appears under Published Parameters, but we still have to
link it to the Generic Writer’s Output Format parameter.
Locate the Output Format parameter of the Generic Writer, right-click on Output Format,
select Link to User Parameter, then select the new Output Format parameter we just created.
Notice how the cogwheel icon turned purple.
One more thing….We’ll set up the workspace so the user gets to choose which layers they
want to request!
It’s actually quite simple.
Expand the Reader|Parameters|Features to Read.
This parameter let’s the user decide which feature types to process when the workspace
is run.
Right-click on Feature Types to Read and select Create User Parameter.
We’ll go with the defaults for the definition, so click OK.
Confirm the new parameter appears under Published Parameters.
Run the workspace again.
Notice that there are two published parameters to select from: you can pick the output format
and choose the feature types to read.
OK, let’s cancel this and get the workspace up on FME Server.
Go to File|Publish to FME Server.
Connect to your FME Server.
If you have not already created a web connection to your FME Server, please see the previous
video.
In the next dialogue select the Server Tutorial repository (if you have just done part 2 it
should already be filled in).
Call the workspace CommunityMapping.fmw (the existing one will be overwritten).
Click Next.
Register the workspace with the Data Download Service (you can leave the Job Submitter checked).
Click Publish and confirm in the log that the workspace was published successfully.
Now open the FME Server web user interface.
Log in with the author/author username/password.
Click Run Workspace.
On the Run Workspace page, select Server Tutorial for the repository and the CommunityMapping
workspace.
Select Data Download for the Service.
Now check out the Published Parameters and you see the 2 we set up and just tested in
Workbench.
Just as before, select an output format, select one or more layers, then click Run.
The Data Download service presents a URL link to the translation results in a zip file.
A quick inspection of the contents of the zip file confirms the results are what we
expected.