I'm executing a geoprocessing script in an ArcGIS JavaScript API map viewer, and it works until I attempt to read the job's output parameter.
My script:
function extractModel(results) {
var params = { "ModelName": ModelName }; // variable defined earlier
// run geoprocessing service to export GDB, download results
var gp = new Geoprocessor("http://myserver/arcgis/rest/services/Test4Custom/GPServer/Custom");
gp.setUpdateDelay(5000); // check status every 5 seconds
gp.submitJob(params, statusDone, statusCallback, errorBack);
}
function errorBack(jobInfo) {
alert.window("Error encountered in geoprocessing script.")
console.log("Status: " + gpStatus);
}
function statusCallback(jobInfo) {
console.log("Status: " + gpStatus + " -- Continuing...");
}
function statusDone(jobInfo) {
console.log("geoprocessing completed");
console.log("Status: " + gpStatus);
console.log("job id " + jobInfo.jobId);
gp.getResultData(jobInfo.jobId, "Output_File", downloadResult, errorBack);
}
function downloadResult(result) {
console.log("displaying result");
console.log(result.value);
console.log(result.dataType);
}
The geoprocessing task executes correctly, and the viewer script is running up until the gp.getResultData
line. It's not getting into the downloadResult()
function, and I'm getting this error in the console:
TypeError: c is not a function(…) "TypeError: c is not a function
Does this indicate a problem with my syntax in calling downloadResult()
, or something else?
Note: The output parameter is indeed Output_File
, and has a string in it when executed. Example:
{
"paramName": "Output_File",
"dataType": "GPString",
"value": "c:\\arcgisserver\\directories\\arcgisjobs\\test4custom_gpserver\\je47fc8d361064c9e86237f397a873118\\scratch\\Data_SALLEY_20151215.gdb"
}
value
is a path or just"helloworld"
. (Eventually, no, it'll be an actual path.)gp
is defined