Question

i would like to change the parameter value in a Server App by passing an attribute at runtime


Badge +6

I have two Workspaces. One creates a KML file of points in countries around the world the KML contains an html popup.

The popup presents a link to a server app, the server app generates a static HTML Page for that country. I want to change the text "country parameter" to the country that the popup is in.

The goal is to create the html only at run time.


10 replies

Userlevel 5
Badge +29

With not knowing exactly how the first process is running, i'm going to make some assumptions.

 

You will want to get the name of the ocuntry on the point, to do this use a transforer such as the PointOnAreaOverlayer, Intersector, SpatialRelator to transfer the country name over to the point.

You'll now be able to use the name of the country in the popup and format the URL to pass the country value through

 

Badge +6

With not knowing exactly how the first process is running, i'm going to make some assumptions.

 

You will want to get the name of the ocuntry on the point, to do this use a transforer such as the PointOnAreaOverlayer, Intersector, SpatialRelator to transfer the country name over to the point.

You'll now be able to use the name of the country in the popup and format the URL to pass the country value through

 

Hello K

 

so can I pass an argument to the Server App similar to ‘country_param_value=“Canada”’

 

jurgen

Badge +2

Hello K

 

so can I pass an argument to the Server App similar to ‘country_param_value=“Canada”’

 

jurgen

Hi @jurgenmack​ ,

For this use case, I think what you are trying to achieve is possible using a webhook URL instead of a Server App for the second workspace, since you do not require any user input and want the workspace to run immediately.

 

A webhook is just a URL that contains the workspace published parameters as part of the query string as opposed to presenting the user with a friendly interface where they can input values for parameters. 

 

You can create a Webhook URL from the Run Workspace page either through Workspace Actions: 

Screen Shot 2022-02-25 at 9.50.11 AMOr under the Advanced section: 

Screen Shot 2022-02-25 at 9.49.40 AMThis will generate a URL with the published parameters in the query string: 

Screen Shot 2022-02-25 at 9.57.04 AMYou can use this URL within your first workspace in the popup, appending the selected response at the end of the request. 

 

Badge +6

Hello K

 

so can I pass an argument to the Server App similar to ‘country_param_value=“Canada”’

 

jurgen

Thanks Holly

 

ill give it a try.

 

jurgen

Badge +6

Hello K

 

so can I pass an argument to the Server App similar to ‘country_param_value=“Canada”’

 

jurgen

Hi Holly

The server keeps authenticating me whenever i run the web hook.

 

Jurgen

Badge +2

Hello K

 

so can I pass an argument to the Server App similar to ‘country_param_value=“Canada”’

 

jurgen

Hi @jurgenmack​ ,

 

Similar to when you create a server app, when you create a webhook URL it will generate a token (third image in my answer above) that has been granted the necessary permissions needed to run the workspace. To not be prompted for your user credentials this token must be submitted with the URL either as a parameter in the query string or through a header.

Badge +6

Hello K

 

so can I pass an argument to the Server App similar to ‘country_param_value=“Canada”’

 

jurgen

No Joy Holly

 

i have tried various ways to include the token with no luck. Now i receive an account locked notification. Could it be my version "FME Server 2021.2 

Build 21784 - linux"

 

Attached is a screen capture of my Webhook page.Screen Shot 2022-03-02 at 12.08.17Here is my url "http://ubuntu:8080/fmedatastreaming/dynamic-html/Dynamic-GAC2-simple-HTML.fmw?SourceDataset_POSTGRES=jiifc&CountryName=country&SourceDataset_PO

STGIS_6=jiifc&token=fbcb257b-3a34-4566-b9fd-3abf991e41a2"

 

Badge +6

Hello K

 

so can I pass an argument to the Server App similar to ‘country_param_value=“Canada”’

 

jurgen

Hi Holly

 

Have you had a chance to look at my screen shots?

Jurgen

Badge +2

Hello K

 

so can I pass an argument to the Server App similar to ‘country_param_value=“Canada”’

 

jurgen

Hi @jurgenmack​ ,

I'm suspicious of the token in use in your URL because it should just be a string of numbers and letters, without dashes.

 

On your screenshot, when you select OK it will take you to a second page and this is where your token is displayed. Once you exit this page for security reasons you will not be able to get the token value from FME Serve UI again. The value in the token name is not equal to the token. I would recommend that you choose the option to 'Download Webhook' and this will contain your token details for you to look back on if you need to.

2022-03-03_10-57-41 

 

Badge +6

Hello K

 

so can I pass an argument to the Server App similar to ‘country_param_value=“Canada”’

 

jurgen

Thanks Holly

Thats got it working. BTW, I read through the entire help section on this and it was not helpful. Maybe someone could give it a second look.

 

Greatly appreciate your help

Jurgen Mack

Reply