添加条件依赖关系到作业

时间:2018-04-20 12:49:27

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

我试图在作业中添加条件依赖项,但我的修改在TWSz AD中不可见:

    JobStream jobStream = new JobStream();
//... new job stream code
Job job01 = new Job();
job01.setName("1");
job01.setPriority(1);
//...first job ZOSJobDefinition
JobKey job01Key = (JobKey)job01.getKey();
jobStream.getJobs().add(job01);
Job job02 = new Job();
//...econd job code
//internal dependency to the first job
InternalDependency job02tojob01 = new InternalDependency(null, job01Key);
job02.getInternalDependencies().add(job02tojob01);
JobKey job02Key = (JobKey)job02.getKey();
Job job03 = new Job();
//job03 code
//job03 ZOSJobDefinition
//job03 internal dependency to first job
InternalDependency job03tojob01 = new InternalDependency(null, job01Key);
job03.getInternalDependencies().add(job03tojob01);
//ConditionalDependency
ConditionalDependency condDep = new ConditionalDependency();
ConditionalJobDependency condJob03toJob02 = new ConditionalJobDependency();
condJob03toJob02.setAbstractJobKey(job02Key);
condJob03toJob02.setConditionCheckType(ConditionCheckType.STATUS_TYPE);
condJob03toJob02.setConditionLogicalOperatorType(ConditionLogicalOperatorType.NE_TYPE);
condJob03toJob02.setConditionStatus(ConditionStatus.COMPLETED_STATUS);
condDep.getConditionalJobDependencies().add(condJob03toJob02);
job03.getConditionalDependencies().add(condDep);
model.addTWSObject(jobStream, null);

正确添加具有作业和内部依赖关系的JobStream anlu条件依赖关系在调度程序中不可见。如何正确地完成它?

1 个答案:

答案 0 :(得分:1)

检查您的TWS环境的版本

版本9.3.0.3上提供了条件依赖性