GeoProcessing Task

680
4
11-27-2012 04:15 AM
CubbySkeete
Esri Contributor
I have a question regarding the geoprocessing class within the ArcGIS API for JavaScript. The question is in regard to using the clip and ship sample. We have a 23 layers we would like to clip and ship. I would like to use the cancelJobStatusUpdates function to allow the server time to clip and ship the layers. I have tried using the SetUpdateDelay function but it still times out for certain areas of the map. I would like to just add a listener to the the geoprocessing task that would wait until the jobinfo.jobstatus has changed to success. How do I successfully use the cancelJobStatusUpdates function even though I don't have my jobInfo defined until my submitJob function is started?
0 Kudos
4 Replies
nicogis
MVP Frequent Contributor
You have yet in submitJob callback and errback for complete job. StatusCallback is optional and you can manage with setUpdadeDelay (for set interval check status) and cancelJobStatusUpdates(jobId) for Cancels the periodic job status updates initiated automatically for when submitJob() is invoked. What's the real problem?
0 Kudos
CubbySkeete
Esri Contributor
My output.zip file is not finished being created before the gp task returns. This causes the 'job (jobid) does not exist or is inaccessible' error. I can look at the server and see that the output.zip is created after the gp task errors out. It will work if I use fewer layers and less time is needed to create the output file, but the more layers I use the longer it takes. I can use the setUpdateDelay function to 2 mins and it works. I don't want to wait 2 minutes, if I only select 2 layers.
0 Kudos
nicogis
MVP Frequent Contributor
Are you using this sample http://help.arcgis.com/en/arcgisdesktop/10.0/help/002v/002v00000019000000.htm ?
Are you using method asynchronous in python ?
0 Kudos
CubbySkeete
Esri Contributor
Yes  I am using that sample and the out of the box python script. I believe the magic number is 10 layers. If you try to clip and ship with more than 10 it will error. My solution was to and the 'setUpdateDelay' to 4 minutes and add the email the zip once it is complete. Thanks again
0 Kudos