Question

Parameters

  • 17 January 2024
  • 5 replies
  • 20 views

Badge

Version - FME 2020

How to import values in the user parameter dynamically(EX. Read the data from Text file(values in the text file keeps changing)


5 replies

Userlevel 3
Badge +26

User parameter values are only read at runtime, so it's not possible for a parameter to be dynamic. If you can provide more info on what you are wanting to accomplish with the values in the text file, we can offer more guidance.

Userlevel 5
Badge +36

You can solve this by using a master workspace that reads the parameter values, and contains a WorkSpaceRunner that starts a second workspace, passing the parameter values.

image

Badge

You can solve this by using a master workspace that reads the parameter values, and contains a WorkSpaceRunner that starts a second workspace, passing the parameter values.

image

Hello Geomancer,

Thank you. I had to change from text file to CSV. I need to pass all the 21 values to the user parameter. Not sure how to pass the parameters and the USER should select one of the value from the 21

image 

 

Userlevel 5
Badge +36

You can solve this by using a master workspace that reads the parameter values, and contains a WorkSpaceRunner that starts a second workspace, passing the parameter values.

image

Hi syarlagadda,

Unfortunately, I don't think this is possible. As fas as I know, there is no user interaction with workspaces that are run from the WorkspaceRunner.

 

There are probably other solutions though. Like using Automations (FME Flow), create a web page to let the user set the parameter, and trigger the workspace from that.

Not really my expertise, so I hope others can help you with this.

Userlevel 3
Badge +26

@geomancer​ @syarlagadda​ For what it's worth, this can be accomplished...but an executable outside of FME will be required. For one project, I had a software engineer develop a simple program that searches a directory for files ending in '.gdb', displays a GUI where the user can select from the list of 'gdbs', and then produces a text file with the gdbs chosen by the user in the GUI. As this relates to your case, the executable would read your text file with the possible values and display those as a selectable list in the GUI. Once the selection is made by the user, the executable would create a temporary, secondary text file containing the values chosen by the user.

 

In FME, a SystemCaller will run the executable. The beauty of this is that FME will 'pause' while the executable is still open. Once the user chooses the values, and the executable has produced the secondary text file, a FeatureReader can be used to read the second text file for further processing in the workbench. (See example below).

 

The creation of the executable falls outside the realm of my expertise here, but the overall methodology works well. Hope this helps.

 

image

Reply