ArcGIS Data Reviewer API for JavaScript
Show:

ReviewerResultsTask Class

Extends _DRSBaseTask

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.

Constructor

ReviewerResultsTask

(
  • url
)

Parameters:

  • url String

    The DataReviewerServer Server Object Extension (SOE) URL.

Example:

   var url = "http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
   var reviewerResultsTask = new ReviewerResultsTask(url);

Methods

createReviewerSession

() Deferred

Inherited from _DRSBaseTask:

Creates a new Reviewer session. The Reviewer session stores results from check and batch job execution.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds ReviewerSession.

getBatchRunDetails

(
  • batchRunIds
)
Deferred

Fetches batch run information from REVBATCHRUNTABLE and REVCHECKRUNTABLE. The response object contains an instance of esri/tasks/FeatureSet that does not contain geometry. The featureset contains the following fields (and associated values):

  • batchJobFile
  • batchRunContext
  • batchRunEndTime
  • batchRunId
  • batchRunStartTime
  • batchRunStatus
  • totalResults
  • totalValidated

Parameters:

  • batchRunIds Array

    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 BatchValidationJobExecutionDetails.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an esri/tasks/FeatureSet.

Example:

            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)
                    {
                        document.write(key + ": " + attributes[key] + "</br>");
                    }
                }
            },
            function(error)
            {
                document.write("Error occurred: " + error.message);
            }
            );

getLayerDefinition

(
  • filters
)
Deferred

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.

Parameters:

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds a String.

getLifecycleStatusStrings

() Deferred

Inherited from _DRSBaseTask:

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.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an array of lifecyclestatus strings.

getResults

(
  • getResultsQueryParameters
  • filters
)
Deferred

Queries records from REVTABLEMAIN, REVBATCHRUNTABLE and REVCHECKRUNTABLE. Returns a non-spatial featureset in the deferred object. Supports all filter types in its filters parameter.

Parameters:

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds a non-spatial esri/tasks/FeatureSet.

getReviewerSessions

() Deferred

Inherited from _DRSBaseTask:

Returns an array of sessions in a Reviewer workspace. Access the array through either the deferred object or the onGetReviewerSessionsComplete event.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an array of ReviewerSession.

Example:

            var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
            var dashboardTask=new DashboardTask(url);
            var deferred=dashboardTask.getReviewerSessions();
            deferred.then(function(response)
                {
                    array.forEach(response.reviewerSessions, function(item,i)
                    {
                        document.write("Session name: " + item.sessionName);
                        document.write("<br/>Session Id: " + item.sessionId);
                        document.write("<br/>User name: " + item.userName);
                        document.write("<br/>Version name: " + item.versionName);
                        document.write("<br/>");
                    });
                },
                function(error)
                {
                    document.write("Error occurred: " + error.message);
                }
            );

updateLifecycleStatus

(
  • sessionId
  • lifecycleStatus
  • technicianName
  • filters
)
Deferred

Updates lifecycle status of the Reviewer results.

Parameters:

  • sessionId Number

    Session that contains results to update.

  • lifecycleStatus Number

    Lifecycle status to which the Reviewer results will get updated.

  • technicianName String

    Name of the technician performing the update.

  • filters ReviewerFilters

    Instance of ReviewerFilters used to query Reviewer results.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object. The response object holds an Array of FeatureEditResult.

writeFeatureAsResult

(
  • reviewerAttributes
  • feature
)
Deferred

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

Parameters:

  • reviewerAttributes ReviewerAttributes

    Class used to encapsulate all fields to be written to the reviewer workspace.

  • feature Graphic

    Feature to write to the reviewer workspace.

Returns:

Deferred: Dojo object. 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.

writeResult

(
  • reviewerAttributes
  • geometry
)
Deferred

Writes a geometry and associated reviewer attributes to the reviewer workspace.

Parameters:

  • reviewerAttributes ReviewerAttributes

    Class used to encapsulate all fields to be written to the reviewer workspace.

  • geometry Geometry

    A geometry (point, polyline or polygon) to write to the reviewer workspace.

Returns:

Deferred: Dojo object. 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.

Events

onCreateReviewerSessionsComplete

Inherited from _DRSBaseTask:

Dispatched by createReviewerSession.

Event Payload:

onError

Inherited from _DRSBaseTask:

Event Payload:

Example:

        // connect to the onError event of the task
        function onErrorHandler(error)
        {
           alert ("An error occurred. Error message = " + 
                  error.message +" Error code = " +error.code);
        }

onGetBatchRunDetailsComplete

Dispatched by getBatchRunDetails.

Event Payload:

onGetLayerDefinitionComplete

Dispatched by getLayerDefinition.

Event Payload:

onGetLifecycleStatusStringsComplete

Inherited from _DRSBaseTask:

Dispatched by getLifecycleStatusStrings.

Event Payload:

  • response Object


    Contains:

    • Array lifecycleStatusStrings

onGetResultsComplete

Dispatched by getResults.

Event Payload:

onGetReviewerSessionsComplete

Inherited from _DRSBaseTask:

Dispatched by getReviewerSessions.

Event Payload:

onUpdateLifecycleStatusComplete

Dispatched by updateLifecycleStatus.

Event Payload:

onWriteFeatureAsResultComplete

Dispatched by writeFeatureAsResult.

Event Payload:

onWriteResultComplete

Dispatched by writeResult.

Event Payload: