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 newJobParameters
object for a specific job to set the parameters of the job.void
run
(JobParameters jobParameters) Runs a job as specified in aJobParameters
object.runJob
(JobParameters jobParameters) Runs a job as specified in aJobParameters
object, and also returns aJobRunResult
object.
-
Method Details
-
newJobParameters
Retrieves a newJobParameters
object for a specific job to set the parameters of the job.For example, the value
record_user_action__v
would 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
JobParameters
object for setting parameters for the specified job
-
run
Runs a job as specified in aJobParameters
object.Job parameters should be set by using
JobParameters.setValue(String, Object)
before running a job.- Parameters:
jobParameters
- aJobParameters
object that contains the job name and parameters
-
runJob
Runs a job as specified in aJobParameters
object, and also returns aJobRunResult
object.Job parameters should be set by using
JobParameters.setValue(String, Object)
before running a job.- Parameters:
jobParameters
- aJobParameters
object 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
-jobInstanceId
of the job instance to cancel
-