TWS Java API editAddJobStreamInstanceWithVariableSubstitution

时间:2018-05-14 12:03:02

标签: java workload-scheduler tivoli-work-scheduler

我正在尝试编辑并向CP添加作业流,但是我再次获得“java.lang.NullPointerException”而没有任何其他信息。

List<ZosJobInfo> jobsToAdd = new ArrayList<>();
ZosJobInfo zosJobInfo = new ZosJobInfo();
zosJobInfo.setJobName("DMSORT");
zosJobInfo.setJobNumber(5);
zosJobInfo.setTimeDependent(false);
zosJobInfo.setWorkstationName("CPU1");
zosJobInfo.setWorkstationType(WorkstationType.COMPUTER);
zosJobInfo.setAutoSubmit(true);
zosJobInfo.setTaskType(TaskTypes.ZOS_JOB_TASK);
zosJobInfo.setDuration(1000L);
zosJobInfo.setCentralizedScript(false);
zosJobInfo.setParallelServer(1);
zosJobInfo.setR1(1);
zosJobInfo.setR2(1);
jobsToAdd.add(zosJobInfo);
HashMap<String, List<Integer>> dependencies = new HashMap<>();
List<Integer> jobPred = new ArrayList<>();
jobPred.add(1);
dependencies.put("5", jobPred);
DateTimeFormatter formatter2 = DateTimeFormat.forPattern("dd-MM-yyyy HH:mm z");
DateTime dateTime2 = DateTime.parse("14-05-2018 10:27 GMT",formatter2);
DateTime dlt = dateTime2.plusMinutes(1);
plan.editAddJobStreamInstanceWithVariableSubstitution(tempJobStream.getName(), dateTime2.toDate(), dlt.toDate(), 5, "EDIT ADD", "", "OWNER", "", "", null, jobsToAdd, null, null, dependencies, null, "", false,DependenciesResolutionOption.RESOLUTION_NONE, null, null);

1 个答案:

答案 0 :(得分:0)

填写要替换的&#34;变量&#34;带有void变量的字段(它是一个String [] []字段)。这应该足以避免空指针异常。