Skip to content

Job Processors

Job processors provide logic to process jobs in bulk. A job processor is a Java class that implements the Job interface and has the @JobInfo annotation. The @JobInfo annotation has the following attributes:

  • adminCancellable: Determines if this job processor permits the cancellation of job instances which are in the QUEUED or QUEUEING state. This does not fully control the ability for a job instance to be cancelled, for example, jobs in the SCHEDULED state can always be cancelled. Learn more about jobs eligible for cancellation in Vault Help. You can use Vault API or VQL to retrieve the status of a job instance.
  • adminConfigurable: Determines if this job processor is available for Vault Admins to configure as a Job Definition in the Vault UI and if custom SDK code can invoke this job processor.
  • idempotent: Indicates if this job processor is idempotent.
  • isVisible: Determines if a job will appear in the Scheduled, Running, and History tables in the Job Admin UI. Learn more about the Vault UI’s Job Status page in Vault Help.

You can invoke a job processor using triggers and actions in Vault Java SDK code. A job processor can also form the logic for a new job definition. Learn more about job definitions in Vault Help.

You can use the Job interface with the following methods to create a job processor:

  • The Job#init method prepares data and performs other initialization logic.
  • The Job#process method executes tasks on the previously initialized data.
  • The Job#completeWithSuccess method runs if all previously processed tasks completed successfully.
  • The Job#completeWithErrors method runs if any of the previously processed tasks encountered errors.

You must associate your custom job processor with a job by adding it to the Job Code field of an SDK Job Metadata record, which corresponds to the job_code field of the Jobmetadata component. Learn more about administering SDK job metadata in Vault Help.

The following is a basic skeleton of a job processor:

@JobInfo(adminConfigurable = true, idempotent = true, isVisible = true) public class CustomSdkJob implements Job { public JobInputSupplier init(JobInitContext context) { } public void process(JobProcessContext context) { } public void completeWithSuccess(JobCompletionContext context) { } public void completeWithError(JobCompletionContext context) { } }