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

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

Description

(Added at v3.14)
Provides functionality to retrieve dashboard results from an ArcGIS Data Reviewer for Server Dashboard REST resource. Dashboard results summarize default and custom (user-defined) fields in a reviewer workspace's REVTABLEMAIN and REVBATCHRUNTABLE tables. Summary values show the number of occurrences of a unique value in a field in these tables.

Samples

Search for samples that use this class.

Constructors

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

Methods

NameReturn typeSummary
createReviewerSession(sessionName, sessionOptions)DeferredCreates a new Reviewer session.
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.
getDashboardFieldNames()DeferredRequests Dashboard results field names.
getDashboardResults(fieldName, filters?)DeferredRequests dashboard results by fieldName.
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.

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 createReviewerSessions method is complete.
error
{
  error: <Error>
}
Fires when an error occurs during a DashboardTask method execution.
get-custom-field-names
{
  customFieldNames: <String[]>
}
Fires when the getCustomFieldNames method is complete.
get-dashboard-field-names
{
  fieldNames: <String[]>
}
Fires when the getDashboardFieldNames method is complete.
get-dashboard-results
{
  dashboardResult: <DashboardResult>
}
Fires when the getDashboardResults 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.
Constructor Details

new DashboardTask(url)

Creates a new DashboardTask object.
Parameters:
<String> url Required The DataReviewerServer Server Object Extension (SOE) URL.
Sample:
require([
  "esri/tasks/datareviewer/DashboardTask"
], function(DashboardTask) { 
  var dashboardTask = new DashboardTask("http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/");
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.

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

getDashboardFieldNames()

Requests Dashboard results field names. The callback function in the deferred object will contain a response object that holds an array of dashboard field names.
Return type: Deferred

getDashboardResults(fieldName, filters?)

Requests dashboard results by fieldName. fieldName can be any of the following:
  • BATCHJOBCHECKGROUP
  • CHECKTITLE
  • FEATUREOBJECTCLASS
  • LIFECYCLESTATUS
  • SESSIONID
  • SEVERITY
  • SUBTYPE
You can also specify custom (user-defined) fields from REVTABLEMAIN for fieldName.
Return type: Deferred
Parameters:
<String> fieldName Required Field name for dashboard results. Use the getDashboardFieldNames function to get field names to use in this parameter.
<ReviewerFilters> filters Optional Instance of ReviewerFilters containing one or more filters used to narrow down dashboard results. Similar to a where clause. See ReviewerFilters
Sample:
var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/"
var dashboardTask=new DashboardTask(url);
var deferred=dashboardTask.getDashboardResults("BATCHJOBCHECKGROUP");

//Deferred callback and errback function
deferred.then(function(response) {
  array.forEach(response.dashboardResult.fieldValues, function (item,i) {
    console.log("BATCHJOBCHECKGROUP Name: " + item);
    console.log("Result count: " + response.dashboardResult.getCount(item));
  });  
}, function(error) {
  console.log("Error occurred: " + error.message);
});

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 dashboardTask=new DashboardTask(url);
var deferred=DashboardTask.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);
});
Event Details
[ On Style Events | Connect Style 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/DashboardTask"
], function(DashboardTask) {
  var dashboardTask = new DashboardTask(url);
  dashboardTask.on("create-reviewer-sessions",function(event){
    console.log("Event: ", event);
  });
});

error

Fires when an error occurs during a DashboardTask 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/DashboardTask"
], function(DashboardTask) {
  var dashboardTask = new DashboardTask(url);
  dashboardTask.on("error",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/DashboardTask"
], function(DashboardTask) {
  var dashboardTask = new DashboardTask(url);
  dashboardTask.on("get-custom-field-names",function(event){
    console.log("Event: ", event);
  });
});

get-dashboard-field-names

Fires when the getDashboardFieldNames method is complete.
Event Object Properties:
<String[]> fieldNames An array property named fieldNames containing the dashboard results field names.
Sample:
require([
  "esri/tasks/datareviewer/DashboardTask"
], function(DashboardTask) {
  var dashboardTask = new DashboardTask(url);
  dashboardTask.on("get-dashboard-field-names",function(event){
    console.log("Event: ", event);
  });
});

get-dashboard-results

Fires when the getDashboardResults method is complete.
Event Object Properties:
<DashboardResult> dashboardResult An instance of DashboardResult containing dashboard results based upon a specific field name and optional filters.
Sample:
require([
  "esri/tasks/datareviewer/DashboardTask"
], function(DashboardTask) {
  var dashboardTask = new DashboardTask(url);
  dashboardTask.on("get-dashboard-results",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/DashboardTask"
], function(DashboardTask) {
  var dashboardTask = new DashboardTask(url);
  dashboardTask.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/DashboardTask"
], function(DashboardTask) {
  var dashboardTask = new DashboardTask(url);
  dashboardTask.on("get-reviewer-sessions",function(event){
    console.log("Event: ", event);
  });
});