Create an Automation App with Geometry Parameters

Tandra Geraedts
Tandra Geraedts
  • Updated

FME Version

Introduction

Using additional inputs as parameters for automation allows for more flexibility in the output. Giving users more options at runtime will enable them to get the exact information from the automation they want, whether using a specific dataset, choosing a geographic area, or selecting which options they want to use as inputs. These are accomplished through Manual Parameters, which are created in the automation canvas. 

Manual parameters are similar to User Parameters in that they allow for input at runtime. User Parameters are created and managed in FME Workbench, allowing users flexibility at run time. Once a workspace is published with user parameters, these can be utilized in FME Flow Automations and automation apps. This tutorial will show you how to create an automation, a manual parameter, and an app with the geometry parameter as input.

This tutorial follows the Using the Geometry Parameter tutorial; you can either do that one first or use the completed workspace provided in this tutorial.

 

What are Geometry Parameters

Geometry parameter allows users to select a geographic area of interest. The selection can be a square, a circle, or a series of points to create a polygon. This parameter is useful when users want to select a specific area of interest rather than running the workspace over the whole dataset. Another example is the closed roads data; you can choose the exact area of interest instead of running the workspace on the entire dataset. 

Please see our documentation for more in-depth information about this parameter and other parameters.

 

Adding Parameters to Your Workspace

If you have completed the previous tutorial, skip these steps and go straight to Building an Automation App (link to section). If you use the workspace provided in this tutorial, please follow these steps to ensure it works correctly. 

 

1. Download ConstructionNotifier.fmwt and Open the File in FME Workbench
The workspace has a user parameter that allows users to select an area of interest at run time. The feature reader transformer reads the address data points for the City of Vancouver. Then, the selected geometry is intersected with the address points, and an Excel sheet is created with the addresses within the area.
ConstructionNotifierWorkspace.png

 

2. Inspect the GeometryReplacer Transformer
Click the GeometryReplacer transformer to bring up the mini toolbar, and click the cog icon to open the Parameters. Check whether the Geometry Source is correctly linked to the user parameter GEOM_COORDS.
ParameterIdentifier.png

 

If this is not set up, you can link the parameter by clicking on the drop-down arrow on the right, selecting User Parameter, and then the name of the parameter you wish to use.
SetGeomCoord.png

 

3. Run the Workspace
It is important to ensure the workspace runs correctly on your computer before uploading it to FME Flow. Click the green arrow from the menu bar to check if “Prompt for Parameters” is checked. Then select “Rerun Entire Workspace”.
RunWorkspace.png

 

4. Upload Workspace to FME Flow
In the menu bar, click the upload button next to the FME Flow connection name to bring up the publish screen.
PublishButton.png

 

Select your FME Flow Connection (1), the repository you wish to publish to (2), and make sure the geodatabase is uploaded as well (3).
PublishtoFMEFlow.png

 

For more detailed instructions on creating an FME Flow connection and uploading workspaces, please see the following instructions:

  • To publish a workspace from FME Workbench to FME Flow, follow the generic instructions below using the specific details listed in the article. If the article does not have a specific repository name listed, we recommend creating a Training repository. If a specific service is not listed in the article, please use the default Job Submitter.

    1. Click Publish

    2. From the File menu, click Publish to FME Flow, or from the toolbar ribbon, click Publish.

      Toolbar Ribbon:


      File Menu:

    3. Add a Web Connection

    4. In the Publish to FME Flow wizard, a FME Flow connection needs to be selected or created. To create an FME Flow connection, click the drop-down under FME Flow Connection and select Connect to FME Flow. For more information on creating or managing web connections, see the documentation.



      The following instructions are for a basic connection, but if your FME Flow is set up for Microsoft Azure, SAML, or Windows Credentials, please see the Using Web Connections to Connect to FME Flow documentation.

      An FME Flow Connection dialog will appear; here, we will set up the connection. The connection information and credentials can be obtained from your FME Flow Administrator. If you have not yet logged into FME Flow after installing, please do so prior to continuing, as you will be prompted to change the password from the default:
      Username: admin
      Password: admin

        • Web Service: FME Flow
        • Server URL: http://localhost
        • Connection Name: Training FME Flow
        • Authentication: Basic
        • Username: your username
        • Password: your password

        Click OK. FME will try to authenticate the connection. Once authenticated, this connection will be available whenever you publish a workspace. The connection will only need to be created once.

        • Web Service: FME Server
        • Connection Name: Training FME Server
        • Server URL: http://localhost
        • Username: your username
        • Password: your password

        Click Authenticate. FME will try to authenticate the connection. Once authenticated, this connection will be available whenever you publish a workspace. The connection will only need to be created once.

        Click Next to move to the Create Repository page of the dialog

    5. Create Repository
    6. Repositories are used to store groups of related items that have been published to FME Flow (similar to directories). Items such as workspaces, source data, custom formats, custom transformers, and templates can be published to a repository.

      If you need to create a new repository, click on the New button next to Repository Name. Enter the repository name and an optional description. Click OK to close the Create New Repository dialog.

      To select an existing repository, click the drop-down next to Repository Name and select the desired repository.

    7. Upload Files
    8. Some workspaces require additional files to run correctly on FME Flow, so these need to be uploaded along with the workspace. To upload files, enable Upload data files at the bottom of the dialog.

      When files are uploaded through the publishing menu, they are stored within the repository. If you want to upload folder files (such as geodatabases) or to specify where the files stored, the Select Files button allows you to do that. For detailed instructions on how to use the Select Files button, see the documentation.

    9. Register Services
    10. The final step before publishing a workspace is to register services. Services control how the data will be output after the workspace is run.

      Services return results in different forms:

      • Data Download Service returns results as a downloadable zip file
      • Data Streaming Service returns results as a data stream
      • Job Submitter Service accepts and runs workspace job requests
      • KML Network Link returns a KML Network Link that can be used in Google Earth
      • Notification Service allows for event-driven messaging

      Typically, the Job Submitter is always enabled, but multiple services can be enabled. Once services have been enabled, click Publish.

    11. Review Translation Log
    12. To confirm whether or not the workspace was published successfully, check the Translation Log. The Translation log will show which repository you published to, which files were included, and a quick link to run the workspace.

 

Create Automation with the Workspace

1. Log on to FME Flow
Go to the FME Flow web UI by entering the URL in a web browser or clicking the link in the translation log from FME Workbench. Select Automations > Create Automation from the side menu to bring up a blank canvas.
CreateAutomation.png

 

2. Create an Automation with a Manual Trigger
On the automations canvas, select the green Trigger box to open up the details pane on the right. In the Trigger drop-down menu, select the first option of “Manual Trigger”.
TriggerDetails.png

 

This is where we add a parameter to allow for custom geometry selection. Next, select the heading “Output Attributes”. Under the Success heading, click the Manage button next to Manual Parameters. A dialog box will open where we can add our parameters.
ManageManualParameters.png

 

The manual parameters editor requires a further selection of which parameter type to add. Select the geometry type at the bottom of the list.
AddGeometryParameter.png

 

Once the type is selected, a form will appear on the right side of the editor. Please give your parameter a name (1), and prompt (2), which is what users will see when they run the automation and coordinates for the bounds of the initial map display (3). The initial bounds can be copied below.

Specify initial bounds for map display:

  • Top (-90..90): 49.2548
  • Left (-180..180): -123.244
  • Bottom (-90..90): 49.3034
  • Right (-180..180): -123.071

ParameterEditorValues.png

 

Once the form is filled out, click OK. The new parameter we created will be displayed in the Manual Trigger Details pane. Click OK to finish configuring the trigger.
ManualParameterCreated.png

 

3. Add a Workspace Action
Click on the orange + sign and select the orange action item to add a new internal action block to the canvas.
AddNewAction.png


Connect the Manual Trigger's success port to the Action block's input port. Then, double-click the action block to open the details pane. Fill in the action, repository, and workspace fields as follows:

  • Action: Run Workspace
  • Repository: Training (or wherever you published the workspace to)
  • Workspace: ConstructionNotifier.fmw

ActionDetails.png

 

In the parameter section, to set the default to the output parameter, we created in the manual trigger, click on the arrow on the right of the field and select Manual Parameters. Then, select the name of the parameter you created. In this example, we called it GeoCoord. This will take the input from the trigger and pass the value to the workspace.
SetManualParameter.png


Once this parameter is set, click Apply to save the action details.

 

4. Save Automation and Perform a Test Run
Before creating an automation app with this automation, we want to ensure it runs. Save, name your automation, and then click start. 
SaveandStart.png

 

Since this automation has a manual trigger, we will also need to click the trigger button.
TriggerAutomation.png

 

A pop-up for the manual parameter input will appear on the screen. Click the blue map icon on the right of the field to bring up a map with the default extents we used in the workspace. After you select an area, the coordinates will appear in the search area field. Click OK to continue running the automation.
OpenMap.png

 

Check the Completed Job log to ensure the workspace was successful and that features were written.
CompletedJobs.png

 

Note that there will be no output if there are no addresses in the area you selected.
TotalFeaturesWritten.png

 

Create Automation App

1. Create a New Automation App
From the left side menu, select Flow Apps and then Create Automation App.
CreateAutomationApp.png

 

A form page will appear, and you can fill out the details of your automation app. Please note that if no automation is configured with a manual trigger, a red warning will appear, saying there are no automations available.
NoManualTriggerWarning.png

 

Fill in the details for your automation app. The name field will appear in the Automation Apps table, and the Title will appear in the browser tab. Take note of the Allowed Users options as well. Automation apps require authentication, so only the specified users or roles can access and run the app. 
CreateAutomationAppForm.png

 

2. Customize your App (Optional) 
You can customize your app in various ways. For more information, please see the details below. This is entirely optional, as your app will work with the default look.

  • The look and feel of your Automation app can be tailored to your organization’s colors, logo, and images. The parameters below used to customize the application run page are all optional. 

    The Icon, Logo, and Banner parameters only support JPEG and PNG file formats.

    1. Browser Icon (optional): The icon will be visible in the browser tab. There is a 300 KB file size limit for icon images. 
    2. Heading Background Color (optional): You can configure the banner's background color at the top of the app page. If it is transparent, it appears behind the Heading Banner. 
    3. Heading Logo (optional): This will appear above the Heading Banner and Heading Background Color. The image has a 1 MB file size limit. 
    4. Heading Banner (optional): This image will appear at the top of the app page. If transparent, it will be placed over the Heading Background Color. The image has a 1 MB file size limit. 
    5. Footer Text (optional): The text appears below the links on the app page. 
    6. Footer Logo (optional): This appears beneath the Footer Text and behind the Footer Banner if it is transparent. The image has a 1 MB file size limit. 
    7. Footer Banner (optional): An image to comprise the banner at the bottom of the app page. If transparent, it appears over the Footer Logo. There is a 1 MB file size limit for the image. 
    8. Run Immediately: Option to configure the Automation app to run immediately once the URL is invoked without displaying a run page. 

 

3. Click OK and Run the Automation App
After clicking OK, you’ll be taken to a new page with a summary of the information regarding the app you just created. The URL created is based on your FME Flow's address and the automation app's name. You don’t need to save any of the information on this page. Click OK to go to the Manage Automation Apps page.

To access your newly created app, go directly to the provided URL or click the view icon in the second-to-last column on the manage automation apps page.ViewAutomationApp.png

 

When you open the app, the Run button is greyed out. This is because the geography parameter was set to required. Click on the black map icon to open the map, select the area, and then the run button will turn blue. Selecting geography in the automation app is the same process as selecting run workspace or triggering the automation manually.AddressestoNotifyApp.png

 

After you click the run button, a green notification will appear saying the automation has been triggered. You can check the completed job log to ensure the automation app has run correctly.

The source Type in the job logs shows where the workspace was run from. If the job was run through “Run Workspace,” the source name and source type will be blank.

TotalFeaturesWritten.png

Typically more actions would be added to the automation to take full advantage of the features of Automations; however, this tutorial was a simple example of how this can be done. 

Data Attribution

The data used here originates from open data made available by the City of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.