Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: BatchValidationTask

require(["esri/tasks/datareviewer/BatchValidationTask"], function(BatchValidationTask) { /* code goes here */ });

Description

(Added at v3.14)
Exposes functions for executing and scheduling Batch Validation in ArcGIS Data Reviewer for Server. Provides functions for managing Batch Validation jobs and information.

Batch Validation operates in two execution modes: adhoc (immediate); scheduled. Adhoc jobs execute immediately and run once. Scheduled jobs run repeatedly according to a schedule and terminate once BatchValidationParameters/maxNumberOfExecutions has been exceeded or BatchValidationParameters/executionEndDate has passed.
See also

Samples

Search for samples that use this class.

Constructors

NameSummary
new BatchValidationTask(url)Creates a new BatchValidationTask object.

Methods

NameReturn typeSummary
cancelJobExecution(jobId)DeferredCancels an executing job.
createReviewerSession(sessionName, sessionOptions)DeferredCreates a new Reviewer session.
deleteJob(jobId)DeferredDeletes an existing scheduled Batch Validation Job.
disableJob(jobId)DeferredPauses an existing Batch Validation Job's schedule.
editJob(jobId, parameters)DeferredEdits the schedule, settings and title of an existing Batch Validation Job.
enableJob(jobId)DeferredRestarts an existing Batch Validation Job's schedule.
executeJob(parameters)DeferredExecutes an adhoc job.
getAdhocJobsList()DeferredRetrieves all adhoc jobs from the server and returns an array of BatchValidationJob with the information.
getCustomFieldNames()DeferredReturns an array of custom field names defined in a Reviewer workspace. Access the array through either the deferred object, get-custom-field-names event, or onGetCustomFieldNamesComplete event. The callback function in the deferred object will contain a response object that holds an array of custom field names defined in a Reviewer workspace.
getJobDetails(jobId)DeferredFetches Batch Validation Job details.
getJobExecutionDetails(jobId)DeferredFetches the Job Execution details of a Batch Validation Job.
getJobIds()DeferredReturns an object that contains Scheduled and AdhocJob IDs in two separate arrays.
getLifecycleStatusStrings()DeferredRetrieves a list of localized life cycle status strings from the Reviewer workspace.
getReviewerMapServerUrl()StringExtracts the MapServer url from the full ArcGIS Data Reviewer for Server SOE url.
getReviewerSessions()DeferredReturns an array of sessions in a Reviewer workspace.
getScheduledJobsList()DeferredRetrieves all scheduled jobs from the server and returns an array of BatchValidationJob with the information.
scheduleJob(parameters)DeferredSchedules a new Batch Validation.

Events

[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.

Events

NameEvent ObjectSummary
cancel-job-execution
{
  canceled: <Boolean>
}
Fires when the cancelJobExecution method is complete.
create-reviewer-sessions
{
  reviewerSession: <ReviewerSession>
}
Fires when the createReviewerSessions method is complete.
delete-job
{
  deleted: <Boolean>
}
Fires when the deleteJob method is complete.
disable-job
{
  disabled: <Boolean>
}
Fires when the disableJob method is complete.
edit-job
{
  edited: <Boolean>
}
Fires when the editJob method is complete.
enable-job
{
  enabled: <Boolean>
}
Fires when the enableJob method is complete.
error
{
  error: <Error>
}
Fires when an error occurs during a BatchValidationTask method execution.
execute-job
{
  jobId: <String>
}
Fires when the executeJob method is complete.
get-adhoc-jobs-list
{
  adhocJobs: <BatchValidationJob[]>
}
Fires when the getAdhocJobsList method is complete.
get-custom-field-names
{
  customFieldNames: <String[]>
}
Fires when the getCustomFieldNames method is complete.
get-job-details
{
  jobDetails: <BatchValidationJob>
}
Fires when the getJobDetails method is complete.
get-job-execution-details
{
  jobInfo: <BatchValidationJobInfo>
}
Fires when the getJobExecutionDetails method is complete.
get-job-ids
{
  adhocJobs: <String[]>,
  scheduledJobs: <String[]>
}
Fires when the getJobIds method is complete.
get-lifecycle-status-strings
{
  lifecycleStatusStrings: <String[]>
}
Fires when the getLifecycleStatusStrings method is complete.
get-reviewer-sessions
{
  reviewerSessions: <ReviewerSession[]>
}
Fires when the getReviewerSessions method is complete.
get-scheduled-jobs-list
{
  scheduledJobs: <BatchValidationJob[]>
}
Fires when the getScheduledJobsList method is complete.
schedule-job
{
  jobId: <String>
}
Fires when the scheduleJob method is complete.
Constructor Details

new BatchValidationTask(url)

Creates a new BatchValidationTask object.
Parameters:
<String> url Required The DataReviewerServer Server Object Extension (SOE) URL.
Method Details

cancelJobExecution(jobId)

Cancels an executing job. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if cancel succeeded or not.
Return type: Deferred
Parameters:
<String> jobId Required Job Id of the batch validation job to cancel.

createReviewerSession(sessionName, sessionOptions)

Creates a new Reviewer session. The Reviewer session stores results from check and batch job execution. The callback function in the deferred object will contain a response object that holds ReviewerSession.
Return type: Deferred
Parameters:
<String> sessionName Required Name of the session to be created.
<SessionOptions> sessionOptions Required Session properties to be used to create the session.

deleteJob(jobId)

Deletes an existing scheduled Batch Validation Job. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the deleteJob function succeeded or not.
Return type: Deferred
Parameters:
<String> jobId Required Job Id of the batch validation job to delete.

disableJob(jobId)

Pauses an existing Batch Validation Job's schedule. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the disableJob function succeeded or not.
Return type: Deferred
Parameters:
<String> jobId Required Job Id of the batch validation job to be disabled.

editJob(jobId, parameters)

Edits the schedule, settings and title of an existing Batch Validation Job. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the editJob function succeeded or not.
Return type: Deferred
Parameters:
<String> jobId Required Job Id of the batch validation job to edit.
<BatchValidationParameters> parameters Required Parameters to change in an existing batch job.

enableJob(jobId)

Restarts an existing Batch Validation Job's schedule. Use enableJob to restart a previously disabled job. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the enableJob function succeeded or not.
Return type: Deferred
Parameters:
<String> jobId Required Job Id of the batch validation job to enable.

executeJob(parameters)

Executes an adhoc job. Adhoc jobs execute immediately and run once. The callback function in the deferred object will contain a response object. The response object holds a jobId String.
Return type: Deferred
Parameters:
<BatchValidationParameters> parameters Required Parameters specifying the details of a job to execute.

getAdhocJobsList()

Retrieves all adhoc jobs from the server and returns an array of BatchValidationJob with the information. The callback function in the deferred object will contain a response object. The response object holds an array of adhocJob IDs.
Return type: Deferred

getCustomFieldNames()

Returns an array of custom field names defined in a Reviewer workspace. Access the array through either the deferred object, get-custom-field-names event, or onGetCustomFieldNamesComplete event. The callback function in the deferred object will contain a response object that holds an array of custom field names defined in a Reviewer workspace. The result of this method can be used to write matching custom field attributes to a Reviewer workspace using ReviewerResultsTask.writeFeatureAsResult method, or can also be used to fetch custom field values from ReviewerResultsTask.getResults method. (Added at v3.15)
Return type: Deferred

getJobDetails(jobId)

Fetches Batch Validation Job details. The callback function in the deferred object will contain a response object that holds an instance of BatchValidationJob.
Return type: Deferred
Parameters:
<String> jobId Required Job Id of the batch validation job.

getJobExecutionDetails(jobId)

Fetches the Job Execution details of a Batch Validation Job. The callback function in the deferred object will contain a response object that holds an instance of BatchValidationJobInfo.
Return type: Deferred
Parameters:
<String> jobId Required Job Id of the batch validation job.

getJobIds()

Returns an object that contains Scheduled and AdhocJob IDs in two separate arrays. The callback function in the deferred object will contain a response object that holds two arrays: adhocJob IDs; scheduleJob IDs.
Return type: Deferred

getLifecycleStatusStrings()

Retrieves a list of localized life cycle status strings from the Reviewer workspace. Each Reviewer result stored in the Reviewer workspace has a life cycle status code that matches one of the strings returned from this method execution. Use these strings to replace the numeric code values when displaying a list of Reviewer results to the user. The callback function in the deferred object will contain a response object that holds an array of lifecyclestatus strings.
Return type: Deferred

getReviewerMapServerUrl()

Extracts the MapServer url from the full ArcGIS Data Reviewer for Server SOE url.
Return type: String

getReviewerSessions()

Returns an array of sessions in a Reviewer workspace. Access the array through either the deferred object or the onGetReviewerSessionsComplete event. The callback function in the deferred object will contain a response object that holds an array of ReviewerSession.
Return type: Deferred
Sample:
var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
var batchValidationTask=new BatchValidationTask(url);
var deferred=BatchValidationTask.getReviewerSessions();
deferred.then(function(response) {
  array.forEach(response.reviewerSessions, function(item,i) {
    console.log("Session name: " + item.sessionName);
    console.log("Session Id: " + item.sessionId);
    console.log("User name: " + item.userName);
    console.log("Version name: " + item.versionName);
  });
},
function(error) {
  console.log("Error occurred: " + error.message);
});

getScheduledJobsList()

Retrieves all scheduled jobs from the server and returns an array of BatchValidationJob with the information. The callback function in the deferred object will contain a response object that holds an array of scheduledJob IDs.
Return type: Deferred

scheduleJob(parameters)

Schedules a new Batch Validation. The callback function in the deferred object will contain a response object that holds a jobId String.
Return type: Deferred
Parameters:
<BatchValidationParameters> parameters Required Parameters for scheduling a batch job.
Event Details
[ On Style Events | Connect Style Event ]

cancel-job-execution

Fires when the cancelJobExecution method is complete.
Event Object Properties:
<Boolean> canceled A boolean property named canceled indicating whether or not the job execution was canceled.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("cancel-job-execution",function(event){
    console.log("Event: ", event);
  });
});

create-reviewer-sessions

Fires when the createReviewerSessions method is complete.
Event Object Properties:
<ReviewerSession> reviewerSession The ReviewerSession created from the createReviewerSession method.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("create-reviewer-sessions",function(event){
    console.log("Event: ", event);
  });
});

delete-job

Fires when the deleteJob method is complete.
Event Object Properties:
<Boolean> deleted A boolean property named deleted indicating whether or not the job was deleted.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("delete-job",function(event){
    console.log("Event: ", event);
  });
});

disable-job

Fires when the disableJob method is complete.
Event Object Properties:
<Boolean> disabled A boolean property named disabled indicating whether or not the job was disabled.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("disable-job",function(event){
    console.log("Event: ", event);
  });
});

edit-job

Fires when the editJob method is complete.
Event Object Properties:
<Boolean> edited A boolean property named edited indicating whether or not the job was edited.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("edit-job",function(event){
    console.log("Event: ", event);
  });
});

enable-job

Fires when the enableJob method is complete.
Event Object Properties:
<Boolean> enabled A boolean property named enabled indicating whether or not the job was enabled.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("enable-job",function(event){
    console.log("Event: ", event);
  });
});

error

Fires when an error occurs during a BatchValidationTask method execution.
Event Object Properties:
<Error> error A JavaScript error object containing the message and code properties that occurred during a BatchValidationTask method execution.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("error",function(event){
    console.log("Event: ", event);
  });
});

execute-job

Fires when the executeJob method is complete.
Event Object Properties:
<String> jobId A string property containing the jobId.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("execute-job",function(event){
    console.log("Event: ", event);
  });
});

get-adhoc-jobs-list

Fires when the getAdhocJobsList method is complete.
Event Object Properties:
<BatchValidationJob[]> adhocJobs An array of BatchValidationJob containing all the adhoc jobs from the server.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("get-adhoc-jobs-list",function(event){
    console.log("Event: ", event);
  });
});

get-custom-field-names

Fires when the getCustomFieldNames method is complete. (Added at v3.15)
Event Object Properties:
<String[]> customFieldNames An array containing custom field names configured in a Reviewer workspace.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("get-custom-field-names",function(event){
    console.log("Event: ", event);
  });
});

get-job-details

Fires when the getJobDetails method is complete.
Event Object Properties:
<BatchValidationJob> jobDetails An instance of BatchValidationJob containing job details.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("get-job-details",function(event){
    console.log("Event: ", event);
  });
});

get-job-execution-details

Fires when the getJobExecutionDetails method is complete.
Event Object Properties:
<BatchValidationJobInfo> jobInfo An instance of BatchValidationJobInfo containing job execution details.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("get-job-execution-details",function(event){
    console.log("Event: ", event);
  });
});

get-job-ids

Fires when the getJobIds method is complete.
Event Object Properties:
<String[]> adhocJobs An object containing a property named adhocJobs with an Array of adhoc job ids.
<String[]> scheduledJobs An object containing a property named scheduledJobs with an Array of scheduled job ids.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("get-job-ids",function(event){
    console.log("Event: ", event);
  });
});

get-lifecycle-status-strings

Fires when the getLifecycleStatusStrings method is complete.
Event Object Properties:
<String[]> lifecycleStatusStrings An array of localized life cycle status strings from the Reviewer workspace.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("get-lifecycle-status-strings",function(event){
    console.log("Event: ", event);
  });
});

get-reviewer-sessions

Fires when the getReviewerSessions method is complete.
Event Object Properties:
<ReviewerSession[]> reviewerSessions An array of sessions in a Reviewer workspace.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("get-reviewer-sessions",function(event){
    console.log("Event: ", event);
  });
});

get-scheduled-jobs-list

Fires when the getScheduledJobsList method is complete.
Event Object Properties:
<BatchValidationJob[]> scheduledJobs An array of BatchValidationJob with the information from the server about all the scheduled jobs.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("get-scheduled-jobs-list",function(event){
    console.log("Event: ", event);
  });
});

schedule-job

Fires when the scheduleJob method is complete.
Event Object Properties:
<String> jobId A string property containing the jobId.
Sample:
require([
  "esri/tasks/datareviewer/BatchValidationTask"
], function(BatchValidationTask) {
  var batchValidationTask = new BatchValidationTask(url);
  batchValidationTask.on("schedule-job",function(event){
    console.log("Event: ", event);
  });
});