zowe/zowe-client-java-sdk

MonitorJobs doesn't return stepData

Closed this issue · 2 comments

If I submit a job and use MonitorJobs to get the Job object back, I cannot get the stepData unless I "refresh" the Job object. For example, if I submit and monitor a job:

Job job2 = submitJobs.submitJob(new Member(partitionedDataset, "LISTDIR").toString());
job2 = monitorJobs.waitForJobOutputStatus(job2);`

job2 will not contain any step data. In order to get stepData, I need to call:

job2 = new GetJobs(connection).getStatusCommon(new CommonJobParams(job2.getJobId().get(),
            job2.getJobName().get(),
            true));

Perhaps we should add an Optional property to the MonitorJobWaitForParams builder for stepData.

@frankgiordano I can add this if you agree.

@corinned I think with the MonitorJobs processing it should retrieve step data by default. We shouldn't toggle it with a flag. I think we can say it is always expected. As such, no additional attribute is needed in MonitorJobWaitForParams.

You can make a PR request with using getStatusCommon instead of getStatus call in MonitorJobs or we can introduce a new method in GetJobs called getStatusWithStepData(String jobName, String jobId) and toggle the CommonJobParams variable inside there.