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

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

Description

(Added at v3.14)
ReviewerResults allows access to the reviewer workspace. Access includes the following functionality:
  • Write data, as results, to the reviewer workspace.
  • Query reviewer workspace feature classes and tables.

Samples

Search for samples that use this class.

Constructors

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

Methods

NameReturn typeSummary
createReviewerSession(sessionName, sessionOptions)DeferredCreates a new Reviewer session.
getBatchRunDetails(batchRunIds)DeferredFetches batch run information from REVBATCHRUNTABLE and REVCHECKRUNTABLE.
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.
getLayerDefinition(filters)DeferredUtility operation that returns a where clause given a set of input filters.
getLifecycleStatusStrings()DeferredRetrieves a list of localized life cycle status strings from the Reviewer workspace.
getResults(getResultsQueryParameters, filters?)DeferredQueries records from REVTABLEMAIN, REVBATCHRUNTABLE and REVCHECKRUNTABLE.
getResultsFieldNames()String[]Retrieves a list of field names that can be used to fetch or query results from 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.
updateLifecycleStatus(sessionId, lifecycleStatus, technicianName, filters)DeferredUpdates lifecycle status of the Reviewer results.
writeFeatureAsResult(reviewerAttributes, feature)DeferredWrites a feature to the reviewer workspace.
writeResult(reviewerAttributes, geometry)DeferredWrites a geometry and associated reviewer attributes to the reviewer workspace.

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
create-reviewer-sessions
{
  reviewerSession: <ReviewerSession>
}
Fires when the createReviewerSession method is complete.
error
{
  error: <Error>
}
Fires when an error occurs during a ReviewerResultsTask method execution.
get-batch-run-details
{
  featureSet: <FeatureSet>
}
Fires when the getBatchRunDetails method is complete.
get-custom-field-names
{
  customFieldNames: <String[]>
}
Fires when the getCustomFieldNames method is complete.
get-layer-definition
{
  whereClause: <String>
}
Fires when the getLayerDefinition method is complete.
get-lifecycle-status-strings
{
  lifecycleStatusStrings: <String[]>
}
Fires when the getLifecycleStatusStrings method is complete.
get-results
{
  featureSet: <FeatureSet>
}
Fires when the getResults method is complete.
get-reviewer-sessions
{
  reviewerSessions: <ReviewerSession[]>
}
Fires when the getReviewerSessions method is complete.
update-lifecycle-status
{
  featureEditResults: <FeatureEditResult[]>
}
Fires when the updateLifecycleStatus method is complete.
write-feature-as-result
{
  success: <Boolean>
}
Fires when the writeFeatureAsResult method is complete.
write-result
{
  success: <Boolean>
}
Fires when the writeResult method is complete.
Constructor Details

new ReviewerResultsTask(url)

Creates a new ReviewerResultsTask object.
Parameters:
<String> url Required The DataReviewerServer Server Object Extension (SOE) URL.
Sample:
var url = "http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
var reviewerResultsTask = new ReviewerResultsTask(url);
Method Details

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.

getBatchRunDetails(batchRunIds)

Fetches batch run information from REVBATCHRUNTABLE and REVCHECKRUNTABLE. The response object contains an instance of FeatureSet that does not contain geometry. The featureset contains the following fields (and associated values):
  • batchJobFile
  • batchRunContext
  • batchRunEndTime
  • batchRunId
  • batchRunStartTime
  • batchRunStatus
  • totalResults
  • totalValidated
The callback function in the deferred object will contain a response object that holds an FeatureSet.
Return type: Deferred
Parameters:
<Array> batchRunIds Required Array of batchRunIds used to get batch run details. Find batch run IDs by checking the batchRunId property of a job's execution details. See BatchValidationJobInfo.
Sample:
var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
var reviewerResultsTask = new ReviewerResultsTask(url);
var ids=["22FE0946-1933-4273-984C-8822D610AB25"]; //a batch run id
var deferred=reviewerResultsTask.getBatchRunDetails(ids);
deferred.then(function(response) {
  var features = response.featureSet.features;
  for (i = 0; i < features.length; i++) {
    attributes = features[i].attributes;
    for (key in attributes) {
      console.log(key + ": " + attributes[key]);
    }
  }
},
function(error)
{
  console.log("Error occurred: " + error.message);
});

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

getLayerDefinition(filters)

Utility operation that returns a where clause given a set of input filters. Use this where clause as the layer definition of the reviewer map service. This restricts the display of features in the Dynamic Layer to those that satisfy the criteria defined in the input filters. The callback function in the deferred object will contain a response object that holds a String.
Return type: Deferred
Parameters:
<ReviewerFilters> filters Required An instance of ReviewerFilters used to create a layer definition.

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

getResults(getResultsQueryParameters, filters?)

Queries records from REVTABLEMAIN, REVBATCHRUNTABLE and REVCHECKRUNTABLE. Returns a non-spatial featureset in the deferred object. Supports all filter types in its filters parameter. The callback function in the deferred object will contain a response object that holds a non-spatial FeatureSet.
Return type: Deferred
Parameters:
<GetResultsQueryParameters> getResultsQueryParameters Required Defines the size and scope of the FeatureSet returned to the callback function.
<ReviewerFilters> filters Optional Instance of ReviewerFilters used to query reviewer results.

getResultsFieldNames()

Retrieves a list of field names that can be used to fetch or query results from reviewer workspace. (Added at v3.15)
Return type: String[]

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 reviewerResultsTask=new ReviewerResultsTask(url);
var deferred=ReviewerResultsTask.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);
});

updateLifecycleStatus(sessionId, lifecycleStatus, technicianName, filters)

Updates lifecycle status of the Reviewer results. The callback function in the deferred object will contain a response object. The response object holds an Array of FeatureEditResult.
Return type: Deferred
Parameters:
<Number> sessionId Required Session that contains results to update.
<Number> lifecycleStatus Required Lifecycle status to which the Reviewer results will get updated.
<String> technicianName Required Name of the technician performing the update.
<ReviewerFilters> filters Required Instance of ReviewerFilters used to query Reviewer results.

writeFeatureAsResult(reviewerAttributes, feature)

Writes a feature to the reviewer workspace. The feature includes geometry and attributes. Attributes are written to matching custom (user-defined) fields in REVTABLEMAIN. Attribute values are discarded if there are no matching fields between the feature object and REVTABLEMAIN. This operation also writes reviewer attributes to the reviewer workspace. Attributes can include the following fields:
  • sessionId
  • severity
  • reviewTechnician
  • reviewStatus
  • subtype
  • notes
  • lifecycleStatus
  • resourceName
  • The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the write operation succeeded or not.
Return type: Deferred
Parameters:
<ReviewerAttributes> reviewerAttributes Required Class used to encapsulate all fields to be written to the reviewer workspace.
<Graphic> feature Required Graphic to write to the reviewer workspace.

writeResult(reviewerAttributes, geometry)

Writes a geometry and associated reviewer attributes to the reviewer workspace. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the write operation succeeded or not.
Return type: Deferred
Parameters:
<ReviewerAttributes> reviewerAttributes Required Class used to encapsulate all fields to be written to the reviewer workspace.
<Geometry> geometry Required A Geometry (point, polyline or polygon) to write to the reviewer workspace.
Event Details
[ On Style Events | Connect Style Event ]

create-reviewer-sessions

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

error

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

get-batch-run-details

Fires when the getBatchRunDetails method is complete.
Event Object Properties:
<FeatureSet> featureSet An instance of FeatureSet containing batch run information from REVBATCHRUNTABLE and REVCHECKRUNTABLE, but does not contain geometry.
Sample:
require([
  "esri/tasks/datareviewer/ReviewerResultsTask"
], function(ReviewerResultsTask) {
  var reviewerResultsTask = new ReviewerResultsTask(url);
  reviewerResultsTask.on("get-batch-run-details",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/ReviewerResultsTask"
], function(ReviewerResultsTask) {
  var reviewerResultsTask = new ReviewerResultsTask(url);
  reviewerResultsTask.on("get-custom-field-names",function(event){
    console.log("Event: ", event);
  });
});

get-layer-definition

Fires when the getLayerDefinition method is complete.
Event Object Properties:
<String> whereClause A String containing the where clause defined by the ReviewerFilters passed to the getLayerDefinition method.
Sample:
require([
  "esri/tasks/datareviewer/ReviewerResultsTask"
], function(ReviewerResultsTask) {
  var reviewerResultsTask = new ReviewerResultsTask(url);
  reviewerResultsTask.on("get-layer-definition",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/ReviewerResultsTask"
], function(ReviewerResultsTask) {
  var reviewerResultsTask = new ReviewerResultsTask(url);
  reviewerResultsTask.on("get-lifecycle-status-strings",function(event){
    console.log("Event: ", event);
  });
});

get-results

Fires when the getResults method is complete.
Event Object Properties:
<FeatureSet> featureSet An instance of FeatureSet containing attributes from REVTABLEMAIN, REVBATCHRUNTABLE and REVCHECKRUNTABLE, but does not contain geometry.
Sample:
require([
  "esri/tasks/datareviewer/ReviewerResultsTask"
], function(ReviewerResultsTask) {
  var reviewerResultsTask = new ReviewerResultsTask(url);
  reviewerResultsTask.on("get-results",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/ReviewerResultsTask"
], function(ReviewerResultsTask) {
  var reviewerResultsTask = new ReviewerResultsTask(url);
  reviewerResultsTask.on("get-reviewer-sessions",function(event){
    console.log("Event: ", event);
  });
});

update-lifecycle-status

Fires when the updateLifecycleStatus method is complete.
Event Object Properties:
<FeatureEditResult[]> featureEditResults An array containing instances of FeatureEditResult.
Sample:
require([
  "esri/tasks/datareviewer/ReviewerResultsTask"
], function(ReviewerResultsTask) {
  var reviewerResultsTask = new ReviewerResultsTask(url);
  reviewerResultsTask.on("update-lifecycle-status",function(event){
    console.log("Event: ", event);
  });
});

write-feature-as-result

Fires when the writeFeatureAsResult method is complete.
Event Object Properties:
<Boolean> success A boolean property named success indicating whether or not the write operation succeeded or not.
Sample:
require([
  "esri/tasks/datareviewer/ReviewerResultsTask"
], function(ReviewerResultsTask) {
  var reviewerResultsTask = new ReviewerResultsTask(url);
  reviewerResultsTask.on("write-feature-as-result",function(event){
    console.log("Event: ", event);
  });
});

write-result

Fires when the writeResult method is complete.
Event Object Properties:
<Boolean> success A boolean property named success indicating whether or not the write operation succeeded or not.
Sample:
require([
  "esri/tasks/datareviewer/ReviewerResultsTask"
], function(ReviewerResultsTask) {
  var reviewerResultsTask = new ReviewerResultsTask(url);
  reviewerResultsTask.on("write-result",function(event){
    console.log("Event: ", event);
  });
});
Show Modal