vendredi 30 janvier 2015

Geoprocessing service fails if output paramter is empty


I have made a network isolation model that lets the user pick a point on the network to simulate a pipe 'failure'/section that needs to be isolated and finds all valves that need to be turned and other affected features (hydrants, buildings, ect.). The model will output feature layers of those features found in the trace from the 4 feature classes, but only if a feature is found from the trace operations. This works fine in Arcmap when ran from the catalog, but not when ran from the server.


The problem is that not all outputs will contain a record for each FC. For instance, a trace may only return a pipe section and 2-3 valves, with no building connection points or hydrants returned. This works fine in ArcMap becuase i use a try/except to assign the results to the output parameters of the script, so if one of the FC has no selected records, the output is not assigned with anything. When ran on the server, this does not seem to work. When i run a process with no hydrants resulting from the trace, the model fails with Error Code 20010 - Invalid return value.


Does the server not adhere to the try/except function? or is there any way to return an empty feature layer if no results are returned for that FC?


Thanks for help





Aucun commentaire:

Enregistrer un commentaire