TWSz Java API Set持续时间

时间:2016-06-23 13:53:31

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

当我尝试使用此代码设置持续时间时:

Job job = new Job();
job.setName("5");
long dur = 1000;
job.setEstimatedDuration(1000);

job.setPriority(-1);

ZOSJobDefinition jobDef = new ZOSJobDefinition();

jobDef.setFlowTargetKey(new FlowTargetKey("CPU1"));
jobDef.setTaskType(TaskTypes.ZOS_JOB_TASK);
jobDef.setJclName("DMSORT");
job.setJobDefinition(jobDef);

我收到错误EQQX489E操作持续时间CPU1 5无效,0 SEC * 100。 我的方式与文档中的方式相同,但我也尝试:

long dur = Long.valueOf(1000);
job.setEstimatedDuration(dur);

long dur = 1000L;
job.setEstimatedDuration(dur);

但我仍然得到同样的错误。

1 个答案:

答案 0 :(得分:0)

文档中有错误的例子。解决方案是:

    Job job = new Job();
    job.setName("5");
    job.setPriority(1);
   **//job.setEstimatedDuration(1000);**

    ZOSJobDefinition jobDef = new ZOSJobDefinition();

    jobDef.setFlowTargetKey(new FlowTargetKey("CPU1"));
    jobDef.setTaskType(TaskTypes.ZOS_JOB_TASK);
    jobDef.setJclName("DMSORT");
    **jobDef.setNormalElapsedTime(1000L);**
    job.setJobDefinition(jobDef);