I am quite new to FME and I am curious to know if there is a way to change the reader(s)/writer(s) using an interactive prompt box.
To be more specific, in my projects I have 3 readers:
ca/sacramento/address
ca/sacramento/roads
ca/sacramento/county
Each time I go to another county, I delete the readers and bring the new ones in:
tx/wise/address
tx/wise/roads
tx/wise/county
I would like to make a variable %path% which should get a value from the prompt box (or command line) so in the end I have a general fme template which I can use by only changing the %path% once.
In this way, maybe I cand run the program from the comand line, specifying the two parameters (state, county) and just let it run
Best answer by takashi
Hi,
In fact, only 'Name' is essential for a command line parameter configuration. Other settings are used to configure user input rules when executing the workspace via FME Workbench. > fme workspacename.fmw --STATE ca For this command line, creating a published parameter named 'SATE' i.e. setting 'STATE' to 'Name' on the 'Add/Edit Parameter' dialog box is the only requirement. Other settings are not related to the command line configuration. Even if you select 'Float' for 'Type', you can pass a character string (e.g. 'ca') to the workspace through the command line.
However, of course the settings had better be suitable for the workspace processing. For example, if the value of 'STATE' will be treated as a character string in the workspace, setting 'Text' or 'Choice' as 'Type' would be preferable.
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
There should be several approaches. Another idea: Create another workspace like Creator -> AttributeCreator -> WorkspaceRunnner. In the workspace, define a published parameter to select a directory path e.g. C:\\...\\tx\\wise, C:\\...\\ca\\acramento... Using AttributeCreator, create 3 source file paths based on the parameter. Then, through WorkspaceRunnder, you can pass those paths to parameters of the original workspace and run it.
I see your point, but I still do not see which type can prompt for the STATE, CITY and so on. Whilst reading the many tutorials, I think I am not quite sure how to create the published parameter (aka: to configure the Add/Edit Prameter box)
Where I want to end up, is to forward the values of those placeholders form the command line:
--[parameter_name] [parameter_value] e.g. --state ca
I know FME's Published Parameters can do this, I am just not quite sure..how
Yes, I saw the documentation but it seemed slightly poor in actually giving an example on how to set up Add/Edit Prameter box for a command line user input.
There many types there, I always read documentation before asking, but I got stuck in the numerous attempts I had in testing it out. I am sure it will all work out in the end. Many thanks for the support
In fact, only 'Name' is essential for a command line parameter configuration. Other settings are used to configure user input rules when executing the workspace via FME Workbench. > fme workspacename.fmw --STATE ca For this command line, creating a published parameter named 'SATE' i.e. setting 'STATE' to 'Name' on the 'Add/Edit Parameter' dialog box is the only requirement. Other settings are not related to the command line configuration. Even if you select 'Float' for 'Type', you can pass a character string (e.g. 'ca') to the workspace through the command line.
However, of course the settings had better be suitable for the workspace processing. For example, if the value of 'STATE' will be treated as a character string in the workspace, setting 'Text' or 'Choice' as 'Type' would be preferable.
The variables are declared in the publshed params section. They work for other processes, but not for this final one. The only exception is (maybe) that here i use a concat format "$(st_cd)$(ct_cd)_$(ct)_view">
Do you know of an operator that can show me the output of C:\\usa\\test_data\\$(st_cd)_$(st_name)\\$(st_cd)$(ct_cd)_$(ct)_view\\overview_$(st_cd)$(ct_cd)_area.shp?
I would like to debug this and to see what it puts in there and I could not find an operator similar to print (or data::dumper) in programming
a probable reason of the problem is the order of parameter definitions. Try moving st_cd, st_name, ct_cd and ct definitions to upper location of the file path parameter definition on the Navigator window. You can arrange the order by dragging the node or selecting shortcut menu - Move Up / Down.
Ok, I know the error; The path is constructed correctly, and the error is:
During translation, some features were read that did not match a reader feature type in the workspace. This can happen if the reader dataset is changed, or a reader feature type removed or renamed.
Ok, the problem can be that the reader changes based on the published parameteres every time. I do not know how to set a dummy reader. What I did is to add a shapefile and then edit its source by link-ing it to a published parameter where I added as a source $variables. It seems this does not work.
that was so easy that I almost fell out of my mind. Thank you.
dunno why I always look for the more complicated way. Will post a new question soon. Now that my workspace is up and running I will try to enhance its usability.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.