Skip to main content

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. 

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

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,


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
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
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

Reply