agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobManager.java
/**
     * Takes an existing {@link Job} and sanitizes it for resubmission. During this process
     * the {@link Job#getArchivePath()}, {@link Job#getArchiveSystem()}, etc. will be updated. In the
     * event that {@link SoftwareParameter} or {@link SoftwareInput} are no longer valid, the
     * job will fail to validate. This is a good thing as it ensures reproducibility. In
     * situations where reproducibility is not critical, the {@code ignoreInputConflicts} and
     * {@code ignoreParameterConflicts} flags can be set to true to update any hidden field
     * defaults or inject them if not previously present.
     *
     * @param originalJob the job to resubmit
     * @param newJobOwner the owner of the new job
     * @param newJobInternalUsername the internal username of the new job
     * @param ignoreInputConflicts if true, ignore hidden input conflicts and update accordingly
     * @param ignoreParameterConflicts if true, ignore hidden parameter conflicts and update accordingly
     * @return a validated {@link Job} representing the resubmitted job with a unique id.
     * @throws JobProcessingException
     * @throws JsonProcessingException
     * @throws IOException
     */
Takes an existing  Job and sanitizes it for resubmission. During this process
the  Job#getArchivePath(),  Job#getArchiveSystem(), etc. will be updated. In the
event that  SoftwareParameter or  SoftwareInput are no longer valid, the
job will fail to validate. This is a good thing as it ensures reproducibility. In
situations where reproducibility is not critical, the  ignoreInputConflicts and
ignoreParameterConflicts flags can be set to true to update any hidden field
defaults or inject them if not previously present.


Takes an existing Job and sanitizes it for resubmission . During this process the Job#getArchivePath () Job#getArchiveSystem () etc . will be updated . In the event that SoftwareParameter or SoftwareInput are no longer valid the job will fail to validate . This is a good thing as it ensures reproducibility . In situations where reproducibility is not critical the ignoreInputConflicts and ignoreParameterConflicts flags can be set to true to update any hidden field defaults or inject them if not previously present .
public static Job resubmitJob(Job originalJob, String newJobOwner, String newJobInternalUsername,
                                  boolean ignoreInputConflicts, boolean ignoreParameterConflicts)
            throws JobProcessingException, JsonProcessingException, IOException {
        boolean preserveNotifications = false;
        JobRequestProcessor processor =
                new JobResubmissionRequestProcessor(newJobOwner,
                        newJobInternalUsername,
                        ignoreInputConflicts,
                        ignoreParameterConflicts,
                        preserveNotifications);
        JsonNode originalJobJson = new ObjectMapper().readTree(originalJob.toJSON());
        Job newJob = processor.processJob(originalJobJson);
        return newJob;
    }
public static Job resubmitJob ( Job originalJob , String newJobOwner , String newJobInternalUsername , boolean ignoreInputConflicts , boolean ignoreParameterConflicts ) throws JobProcessingException , JsonProcessingException , IOException { boolean preserveNotifications = false ; JobRequestProcessor processor = new JobResubmissionRequestProcessor ( newJobOwner , newJobInternalUsername , ignoreInputConflicts , ignoreParameterConflicts , preserveNotifications ) ; JsonNode originalJobJson = new ObjectMapper ( ) . readTree ( originalJob . toJSON ( ) ) ; Job newJob = processor . processJob ( originalJobJson ) ; return newJob ; }
Takes an existing {@link Job} and sanitizes it for resubmission.
Takes an existing { @link Job } and sanitizes it for resubmission .