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
Methods
createReviewerSession(sessionName, sessionOptions) | Deferred | Creates a new Reviewer session. |
getBatchRunDetails(batchRunIds) | Deferred | Fetches batch run information from REVBATCHRUNTABLE and REVCHECKRUNTABLE . |
getCustomFieldNames() | Deferred | 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. |
getLayerDefinition(filters) | Deferred | Utility operation that returns a where clause given a set of input filters. |
getLifecycleStatusStrings() | Deferred | Retrieves a list of localized life cycle status strings from the Reviewer workspace. |
getResults(getResultsQueryParameters, filters?) | Deferred | Queries 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() | String | Extracts the MapServer url from the full ArcGIS Data Reviewer for Server SOE url. |
getReviewerSessions() | Deferred | Returns an array of sessions in a Reviewer workspace. |
updateLifecycleStatus(sessionId, lifecycleStatus, technicianName, filters) | Deferred | Updates lifecycle status of the Reviewer results. |
writeFeatureAsResult(reviewerAttributes, feature) | Deferred | Writes a feature to the reviewer workspace. |
writeResult(reviewerAttributes, geometry) | Deferred | Writes 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.
Constructor Details
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
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
.
Parameters:
<String > sessionName |
Required |
Name of the session to be created. |
<SessionOptions > sessionOptions |
Required |
Session properties to be used to create the session. |
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.
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);
});
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)
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.
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.
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.
Retrieves a list of field names that can be used to fetch or query results from reviewer workspace. (Added at v3.15)
Extracts the MapServer url from the full ArcGIS Data Reviewer for Server SOE url.
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
.
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);
});
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.
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. |
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.
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. |
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.
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 ]
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);
});
});
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);
});
});
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);
});
});
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);
});
});
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);
});
});
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);
});
});
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);
});
});
Fires when the getReviewerSessions method is complete.
Sample:
require([
"esri/tasks/datareviewer/ReviewerResultsTask"
], function(ReviewerResultsTask) {
var reviewerResultsTask = new ReviewerResultsTask(url);
reviewerResultsTask.on("get-reviewer-sessions",function(event){
console.log("Event: ", event);
});
});
Fires when the updateLifecycleStatus method is complete.
Sample:
require([
"esri/tasks/datareviewer/ReviewerResultsTask"
], function(ReviewerResultsTask) {
var reviewerResultsTask = new ReviewerResultsTask(url);
reviewerResultsTask.on("update-lifecycle-status",function(event){
console.log("Event: ", event);
});
});
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);
});
});
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);
});
});
Fires when the createReviewerSessions method is complete.
Event Object Properties:
<ReviewerSession > reviewerSession |
The ReviewerSession created from the createReviewerSession method. |
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. |
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. |
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. |
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. |
Fires when the getLifecycleStatusStrings method is complete.
Event Object Properties:
<String[] > lifecycleStatusStrings |
An array of localized life cycle status strings from the Reviewer workspace. |
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. |
Fires when the getReviewerSessions method is complete.
Fires when the updateLifecycleStatus method is complete.
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. |
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. |