Variable file name with geoprocessing service?

2297
2
11-07-2011 05:34 AM
MelissaTalley
New Contributor
I currently have a model which attaches a datestamp to every file it creates so as to allow different users to run it at the same time on the web and produce different files. The variable is calculated in my model and is called date so all the files are named %date%something in the model. The output is named %date%final.shp

This isn't a problem when I run the model from the toolbox. However when I publish it as a geoprocessing service and try and run it I get an error that says

"ERROR Invalid return value: C:\Users\WinSSHD_VirtualUsers\Downloads\WebGIS project\Counties00_08_web\scratch\%date%final.shp

2011-11-05 21:30:37

webGIS/Shock_Models.GPServerSync "

I can see why it doesn't like the return value since the name isn't actually %date%final.shp. Is there a way to indicate that the name isn't constant so that I can run it as a service?
0 Kudos
2 Replies
KevinHibma
Esri Regular Contributor
Hi Melissa,

I think I understand what you're doing.
Could I suggest another solution?

Server handles the problem of files colliding when many people are running the service. Each execution server handles is done in a unique directory, because of this the files you output from the GP processes will never be in conflict with each other.

You handle writing output to the scratchworkspace.
In the end output of your model, if you were to change the output to:
%scratchworkspace%\myShapefile.shp

.... everything should be good.

The topic here explains:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Creating_models_for_geoprocessing_serv...

Give a read, by using this method you wouldn't have to use the Calc -> date method.

Hope this helps.
0 Kudos
MelissaTalley
New Contributor
Thank you! This and the link seem to really explain not only the output problem, but an intermediate data problem I've been having with the model.
0 Kudos