In part 3 of this tutorial, you'll learn how to enable an FME Workspace for self-serve data access so anyone can download your data. This involves creating published parameters in FME Workbench, publishing the workspace to FME Server, and running the workspace from the web user interface.
filegdb2generic.fmwt (Community Mapping Workspace)
In part 2, you learned how to publish a workspace to FME Server and run it from the web user interface. Now, in part 3, you will modify that workspace so it allows for “self-serve” data access. To accomplish this, perform the following:
a) Open workspace
Open the workspace from Part 2 in FME Workbench. Alternatively, open the template attached to this article (filegdb2generic.fmwt) in FME Workbench.
On the Generic Writer, the default writer format is set to Esri Shapefile. But, the goal 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.
b) 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.
So, create a new user parameter, and define it accordingly....
c) Right-click on the Published Parameters node and select Add 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, GML, Bentley Microstation Design V8, and MapInfo TAB. 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.
d) Link Published Parameter to Output Format Parameter
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.
e) Run the workspace
Notice only those 4 formats are presented now in the dropdown list for output format. Pick GML. The workspace runs successfully.
f) Publish Features Types to Read Parameter
Set up the workspace so the user gets to choose which layers they want to request! It’s actually quite simple.
- Expand the File Geodatabase Reader|Parameters|Features to Read. This parameter let’s the user decide which feature types to process when the workspace runs.
- Right-click on Feature Types to Read and select Create User Parameter. Go with the defaults for the definition, and click OK. Confirm the new parameter appears under Published Parameters.
g) Run Workspace with Prompt and Run
- Make sure that from the Run menu that Run with Prompt is checked, otherwise this workspace will run with default values.
- Run the workspace again.
Notice that this time there are 2 parameters to set.
a) Go to File|Publish to FME Server
Connect to your FME Server
- Enter your Server URL, then connect with a username & password. We can use the default author/author username/password.
- 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 (leave the Job Submitter service checked).
- Click Publish and confirm in the log that the workspace was published successfully.
a) Open the FME Server web user interface
Log in with the author/author username/password.
b) Click Run Workspace
On the Run Workspace page, select Server Tutorial for the repository and the CommunityMapping workspace. Select Data Download for the Service.
Check out the Published Parameters. The 2 that were set up and just tested in FME Workbench are shown. Just as before, select an output format, and select one or more layers.
Click Run Workspace.
c3) Results Page
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.
Note: The parameters in this workspace were all set up manually to demonstrate how to work with published parameters. A quicker way to create the workspace is select the Dynamic Schema option when generating the new workspace.
1 Person is following this .