Hi guys,
I published a very simple geoprocessing tool from ArcGIS Pro v3.1 to ArcGIS Server v11.1. The inputs are fixed for a test purpose but when I execute it from a Javascript application with Maps SDK v4, it returns very different results every time. At a time, it even returns empty data. The processing time is around 2 or 3 seconds. So, it is mush faster than timeouts.
The model uses "Extract Values to Table" tool and the input features and input rasters parameters are fixed. When I run it within ArcGIS Pro, it produces a table in a file geodatabae with 7092 rows. However, when I call it from the Javascript application, sometimes it returns around 120, 650 or 1200 rows (features) or even zero row.

And the code snippet is here. I use ArcGIS Maps SDK v4.
const params= {
Extract_Values: "outputTable"
};
geoprocessor.submitJob(gpUrl, params)
.then((jobInfo) => {
const jobid = jobInfo.jobId;
console.log("ArcGIS Server job ID: ", jobid);
const options = {
interval: 1500,
statusCallback: (j) => {
console.log("Job Status: ", j.jobStatus);
}
};
jobInfo.waitForJobCompletion(options).then(() => {
if (jobInfo.jobStatus == "job-succeeded") {
jobInfo.fetchResultData("Extract_Values")
.then((result) => {
const cellValues = result.value.features.map(item => item.attributes.Value);
// it shows 120, 650 or 1200 rows or even empty.
console.log(cellValues);
});
}
});
})
.catch((error) => {
console.error("Error:", error);
});
The results would look like:
{
paramName: "Extract_Values",
dataType: "GPRecordSet",
value: {
exceededTransferLimit: false,
displayName: "",
fields: [
{name: "OID", type: "esriFieldTypeOID", alias: "OID"},
{name: "Value", type: "esriFieldTypeDouble", alias: "Value"},
{name: "SrcID_Feat", type: "esriFieldTypeInteger", alias: "SrcID_Feat"},
{name: "SrcID_Rast", type: "esriFieldTypeInteger", alias: "SrcID_Rast"}
],
// there could be 120, 650 or 1200 features or empty []
features: [
{attributes: {OID: 1, Value: ...., SrcID_Feat: ..., SrcID_Rast: ...}},
{attributes: {OID: 2, Value: ...., SrcID_Feat: ..., SrcID_Rast: ...}},
...
]
}
}
Any thoughts about why the results vary every time?