1

我想创建一个包含字符串列表(集线器代码列表)的参数。此字符串列表是通过读取外部 csv 文件创建的(此列表可能包含不同的代码,具体取决于 CSV 文件中的集线器代码)

我想要的是找到一种简单的自动方法来执行列表中每个集线器代码的批处理运行。

所以这个问题是:

1) how to add and set a new parameter directly from the code (during the initialization when reading the CSV) instead of GUI parameter panel? 
2) how to avoid manual configuration of hub list in the batch run configuration
4

1 回答 1

3

像这样添加参数的东西应该在你的 ContextBuilder 中工作。

Parameters params = RunEnvironment.getInstance().getParameters();
((DefaultParameters)params).addParameter("foo", "Big Foo", Integer.class, 3, false);

您将读取 csv 文件以获取参数名称和值。

我不确定我是否完全理解批处理运行配置问题,但每个批处理运行都有一个与之关联的运行编号

RunState.getInstance().getRunInfo().getRunNumber()

如果您可以将 csv 参数文件中的行号与运行号相关联(例如,运行号 1 应该使用第 1 行,依此类推),那么每个批处理运行将使用不同的参数行。

于 2020-06-04T13:14:31.710 回答