I have created a geoprocessing service that allows the user to draw a route to download pdf files via a zip file.
The process is as follows:
1) The user draws the route (polyline) of interest (interactive feature set input)
2) The route is buffered to 100 feet
3) The 100 foot buffer is used to select features from 4 different polyline layers
4) (PYTHON MAGIC) arcpy.SearchCursor() is used to extract the pdf file ID (ex. S-0123.pdf) from each selected feature
5) The file IDs are appended to a python list. The list is used to search, copy, and zip the pdf files from our archive.
6) A "file" output link is presented to download the zip file containing the pdf files.
I have attached a screenshot of the model corresponding to the process above.
ISSUE:
The GP Service runs on our Web Application and the output looks like this:
I do not know why the previous selections are remaining. I clear cache and hard reload and this still happens. It does not happen when I run the GP tool in ArcMap prior to publishing.
I am using arcpy.env.ScratchFolder to allow for the "FILE" datatype output
Has anyone had any similar issues with GP Services selecting features?
UPDATE:
Solution
Using the rubber ducky method, I believe I've found the solution. The problem seemed to be that the layers were not being deselected between every job in the web application like they were in ArcMap. So I had added "Select by Attribute" tools to my model using the "CLEAR SELECTION" option. This ensures that any current selection is cleared prior to the "NEW SELECTION" taking place.
Model looks like this now: