Passing parameters to an Agent from the File

To make the process of passing of the parameters list easier we can create them in the separate files (CSV, XML or Excel file). The program will read the parameters from the file and run the agent for each set of the parameters.

Passing the parameters with the CSV file

You need to create a text file with the parameters. Every parameter set should be in a separate line, the parameters should be separated by commas. It is important to have a header containing parameter names. For example, for an agent with two input parameters First Name and Last Name , the parameter file will have a look:

Passing parameters from CSV file
The following arguments are available:
  • -paramfile (path to the file containing the parameters)
  • -paramseparator (a separator in the parameter line, it is an optional parameter, it is , (comma) by default)

The example of the command running Agent1 located in the project peoplesearch.zws with the parameters in the file C:\projects\persons.csv

ws4console.exe -file peoplesearch.zws -run Agent1 -paramfile C:\projects\persons.csv

Passing the parameters with the Excel file

You need to create an Excel file with a separate column for each parameter. The column name (the first cell) should have parameter name. It can be look like:

Passing parameters from Excel file
The following arguments are available:
  • -paramfile (path to the file containing the parameters)
  • -paramsheet (name of the parameter sheet in the Excel document)

The example of the command running Agent1 located in the project peoplesearch.zws with the parameters in the file C:\projects\persons.xls and in the Sheet1

ws4console.exe -file peoplesearch.zws -run Agent1 -paramfile C:\projects\persons.xls -paramsheet Sheet1

Page Modified 6/9/17 10:12 AM