I would like to change the deadline of a job within a specific jobstream using the Java-API. Updating the deadline of the jobstream itself gives no issues. Using a queryfilter on jobstream-level I get the jobstreamheader-id (jsh) and instantiate a JobStream object. This can be modified and set back.
JobStream js = (JobStream) model.getTWSObject(JobStream.class, jsh.getId(), false, context);
TimeRestrictions t = js.getTimeRestrictions();
t.setDeadlineOffset(Long.parseLong(newDlineOffset));
js.setTimeRestrictions(t);
model.setTWSObject(js, false, false, context);
However I don't see how I can update the timerestrictions of the Jobs within the JobStream. I can get a list of jobs in the jobstream, and find the timerestrictions of those jobs themselves:
List<Job> joblist = js.getJobs();
for (Job j : joblist) {
j.getTimeRestrictions().getDeadlineOffset();
}
However, after editing the job-object I cannot seem to update the jobstream-object again; there is no setJobs-function for the jobstream-object.
Does anybody have an idea how I can realize this?
Turned out it wasn't necessary to explicitly set the Job of the JobStream again. When editing the Job, and then just setting the JobStream object, the edited Job-properties were also included in the JobStream-object.