Skip to main content
Question

Passing *Multiple* Published Parameter from the Command Line


robertr
Contributor
Forum|alt.badge.img+6

Hello,

To state it clearly, currently I am passing a set of values:

--name Robert --city Calgary

I have to do this for multiple names and cities. How can I pass multiple names and cities into one command line so fme would take them one by one. Somthing like

--name "Robert" "David" "Marc" "Jason" --city "Calgary" "El Paso" "Indy" "Vegas"

The expected outcome should be to run the workbench with the values: Robert - Calgary, then with David - El Paso and so on.

I am trying to find an easy sollution to cope with this situation. Currently I am waiting for one to finish, then I add the next one and so on. 

5 replies

david_r
Celebrity
  • August 21, 2013
Hi Robert,

 

 

FME will not automatically iterate over a list of values like this, you will have to implement the iteration yourself.

 

 

One way could be to pass all the city names into one string with a suitable separator, e.g.

 

 

--city "Calgary;El Paso;Indy;Las Vegas"

 

 

You could then use an AttributeSplitter on ";" to create a list of all the city names before you treat them further, for example with a WorkspaceRunner.

 

 

David

robertr
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • August 21, 2013

Hello all,

Ok, it seems I really need to figure out this workspace runner thing. I kept avoiding it but it seems really useful.

Can you provide me a link where it is well explained and maybe I have an example of its usefulness using published params from command line?

Thanks guys,


david_r
Celebrity
  • August 21, 2013
Hi Robert,

 

 

the WorkspaceRunner is really very simple. It is nothing more than a transformer that enables you to run another workspace.

 

 

Have a look here:

 

http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/workspacerunner.htm

 

 

David

takashi
Evangelist
  • August 21, 2013
Yes, usage of the WorkspaceRunner itself is very simple. I agree with David on this point.

 

But in this case, I think you need to create features having a pair of name and city as its attributes before applying the WorkspaceRunner. It might be a little complicated.

 

This image is just an example, please customize to your actual situation.

 

Assume the main workspace has two published parameters - "NAME" and "CITY".

 

 

 

 

 

Takashi

takashi
Evangelist
  • August 21, 2013
P.S. By the way, do you absolutely need to pass names and cities to the workspace via command line?

 

If I were you, I would consider another approach. That is to create a table having two columns (name and city), and pass the table file path to the workspace.

 

Takashi

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings