ReviewerResultsTask Class
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
StringThe DataReviewerServer Server Object Extension (SOE) URL.
Example:
var url = "http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
var reviewerResultsTask = new ReviewerResultsTask(url);
Item Index
Methods
Methods
createReviewerSession
()
Deferred
Creates a new Reviewer session. The Reviewer session stores results from check and batch job execution.
Returns:
getBatchRunDetails
-
batchRunIds
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
ArrayArray 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:
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
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:
-
filters
ReviewerFiltersInstance of ReviewerFilters used to create a layer definition.
Returns:
getLifecycleStatusStrings
()
Deferred
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:
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.
Parameters:
-
getResultsQueryParameters
GetResultsQueryParametersDefines the size and scope of the featureset returned to the callback function.
-
filters
ReviewerFilters(optional) Instance of ReviewerFilters used to query reviewer results.
Returns:
getReviewerSessions
()
Deferred
Returns an array of sessions in a Reviewer workspace. Access the array through either the deferred object or the onGetReviewerSessionsComplete event.
Returns:
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
Updates lifecycle status of the Reviewer results.
Parameters:
-
sessionId
NumberSession that contains results to update.
-
lifecycleStatus
NumberLifecycle status to which the Reviewer results will get updated.
-
technicianName
StringName of the technician performing the update.
-
filters
ReviewerFiltersInstance of ReviewerFilters used to query Reviewer results.
Returns:
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
Parameters:
-
reviewerAttributes
ReviewerAttributesClass used to encapsulate all fields to be written to the reviewer workspace.
-
feature
GraphicFeature to write to the reviewer workspace.
Returns:
writeResult
-
reviewerAttributes
-
geometry
Writes a geometry and associated reviewer attributes to the reviewer workspace.
Parameters:
-
reviewerAttributes
ReviewerAttributesClass used to encapsulate all fields to be written to the reviewer workspace.
-
geometry
GeometryA geometry (point, polyline or polygon) to write to the reviewer workspace.
Returns:
Events
onCreateReviewerSessionsComplete
Dispatched by createReviewerSession.
Event Payload:
-
response
Object
Contains:
onError
Event Payload:
-
error
Error
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:
-
response
Object
Contains:
onGetLayerDefinitionComplete
Dispatched by getLayerDefinition.
onGetLifecycleStatusStringsComplete
Dispatched by getLifecycleStatusStrings.
onGetReviewerSessionsComplete
Dispatched by getReviewerSessions.
Event Payload:
-
response
Object
Contains:
onUpdateLifecycleStatusComplete
Dispatched by updateLifecycleStatus.
Event Payload:
-
response
Array
Contains:
onWriteFeatureAsResultComplete
Dispatched by writeFeatureAsResult.
onWriteResultComplete
Dispatched by writeResult.