Package com.veeva.vault.sdk.api.job
Interface JobService
- All Superinterfaces:
Service
Service interface to run jobs with specified parameters.
-
Method Summary
Modifier and TypeMethodDescriptioncancel(JobCancelRequest jobCancelRequest) Cancels one currently running job entry.Creates a newJobCancelRequest.Builder.newJobParameters(String jobName) Retrieves a newJobParametersobject for a specific job to set the parameters of the job.voidrun(JobParameters jobParameters) Runs a job as specified in aJobParametersobject.runJob(JobParameters jobParameters) Runs a job as specified in aJobParametersobject, and also returns aJobRunResultobject.
-
Method Details
-
newJobParameters
Retrieves a newJobParametersobject for a specific job to set the parameters of the job.For example, the value
record_user_action__vwould be used to create job parameters for the job that will run a user action for a collection of Vault records.- Parameters:
jobName- name of a Vault job- Returns:
- a
JobParametersobject for setting parameters for the specified job
-
run
Runs a job as specified in aJobParametersobject.Job parameters should be set by using
JobParameters.setValue(String, Object)before running a job.- Parameters:
jobParameters- aJobParametersobject that contains the job name and parameters
-
runJob
Runs a job as specified in aJobParametersobject, and also returns aJobRunResultobject.Job parameters should be set by using
JobParameters.setValue(String, Object)before running a job.- Parameters:
jobParameters- aJobParametersobject that contains the job name and parameters- Returns:
- JobRunResult object, which allows you to obtain the job ID
-
newCancelJobRequestBuilder
JobCancelRequest.Builder newCancelJobRequestBuilder()Creates a newJobCancelRequest.Builder.- Returns:
- a new JobCancelRequest.Builder
-
cancel
Cancels one currently running job entry. In the process, skips all job tasks that have not yet completed. ExecutesJob.completeWithError(JobCompletionContext)on completion. Cancelled tasks will haveTaskState.FAILED_TO_RUN. This operation cannot be rolled back.- Parameters:
jobCancelRequest-jobInstanceIdof the job instance to cancel
-