Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TWSz Java API重新启动和重新启动以及计划中的清理作业_Java_Workload Scheduler_Tivoli Work Scheduler - Fatal编程技术网

TWSz Java API重新启动和重新启动以及计划中的清理作业

TWSz Java API重新启动和重新启动以及计划中的清理作业,java,workload-scheduler,tivoli-work-scheduler,Java,Workload Scheduler,Tivoli Work Scheduler,我正在寻找一个如何使用twszjavaapi重新启动和清理计划中的作业的示例。对于简单的重新启动,我正在更改作业的状态 plan.setJobInstanceStatus(jobInPlanList.get(0).getId(), FlowNodeInternalStatusType.FLOW_NODE_ZOSSTATUS_READY, "", null); 我不知道这样做是否正确?我可以;找不到重新启动和清理的方法,我尝试使用组合: plan.beginJobRestartCleanup p

我正在寻找一个如何使用twszjavaapi重新启动和清理计划中的作业的示例。对于简单的重新启动,我正在更改作业的状态

plan.setJobInstanceStatus(jobInPlanList.get(0).getId(), FlowNodeInternalStatusType.FLOW_NODE_ZOSSTATUS_READY, "", null);
我不知道这样做是否正确?我可以;找不到重新启动和清理的方法,我尝试使用组合:

plan.beginJobRestartCleanup
plan.executeJobRestartCleanup
plan.commitJobRestartAndCleanup

但是没有什么能正常工作。

对于简单重启,可以将作业状态设置为就绪。 关于重启和清理,应使用以下流程: -设置需要传递给BeginJobRestartCleanupAPI的RestartCleanupOptions参数 -如果需要,修改要重新启动的作业 -承诺 -使用try-catch块和rollbackJobRestartCleanup处理可能的异常

以下是一个例子:

    try
    {
        /*
         * start the cleanup session, modify parameters if needed
         */
        RestartCleanupOptions rco = new RestartCleanupOptions();
        rco.setAction(RestartCleanupType.ACTION_JOBRERUN);
        rco.setCleanup(CleanUpOption.MANUAL);
        rco.setUseExpandedJCL(false);
        plan.beginJobRestartCleanup(restartID, rco, null);


        /*
         * Now get datasets lists for the specified restart step
         */
        List datasetList = plan.getJobDataSets(restartID, null);

        /* Here you can modify datasetList if needed*/

        /*
         * Now set the datasets
         */
        plan.setJobDataSets(restartID, datasetList, null);
        /*
         * Now get the JCL
         */
        JobControlLanguage jcl = plan.getJobJCL(restartID, true, null);

        /* Here you can modify jcl if needed*/

        /*
         * Now set the JCL
         */
        plan.setJobJCL(restartID, jcl, true, null);
        /*
         * Execute the step-restart operation
         */
        plan.executeJobRestartCleanup(restartID, "JCL", null, null, null);
        /*
         * commit the step restart phase
         */
        plan.commitJobRestartAndCleanup(JobInPlan.class, restartID, null);

    }
    catch (ConnException e)
    {
        plan.rollbackJobRestartAndCleanup(JobInPlan.class, restartID, null);
    }
我希望这会有帮助