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?
in order to update a job inside the job stream you should change the value in the job and then set the job stream again
In your example:
I hope this can help.
Lorenzo