Geoprocessing Service using Model Builder Iterators?

1833
15
05-26-2011 04:37 AM
HeatherLizama
New Contributor
Hi,

Currently I have a model that works on desktop but does not run as a service. I have narrowed down the issue to a failure of the tool, "Iterate Field Values" that is available in model builder.

Is it even possible to use the iterator tools (available in Model Builder - ArcGIS 10) and have it run as a service? Or should I have only python scripts that complete the iterations?

Thank you for your help! H
0 Kudos
15 Replies
HeatherLizama
New Contributor
Please see the attached image of a portion of my model that does work on desktop but does not work as a service. Any suggestions would be appreciated!
0 Kudos
AndrewChapkowski
Esri Regular Contributor
Did you follow all the guidelines found here: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Checklist_for_authoring_and_publishing...

Are all results being written to %ScratchWorkspace% or %ScratchWorkspace%\scratch.gdb ?
0 Kudos
HeatherLizama
New Contributor
Thank you Andrew for your reply.

Yes, I have gone through the services checklist quite a few times in the testing process.

Yes, I am also using %scratchworkspace% for output parameters.

Are model iterators possible in a service? Thanks!
0 Kudos
AndrewChapkowski
Esri Regular Contributor
Iterate value worked for my published model, I think your problem stems from the return type.   It looks like you are trying to return each feature class, which isn't supported at this time.  In short, Multi-feature outputs aren't supported yet.  I would suggest returning a zip file to the end user of your extracted data. 

Andrew
0 Kudos
HeatherLizama
New Contributor
Hi Andrew,
That is great to know that model iterators will work in a service.

The model that I posted is only a portion of the total process. I learned through testing that submodels would not work properly in a service, so I have split the whole process into three GP services that will be called by Flex to run consecutively. The final output is tabular statistics.

Adding the zip option to the end of each model, then unzipping for the next model, would add run time. Is there no other way to have multiple feature set/feature class output?
0 Kudos
AndrewChapkowski
Esri Regular Contributor
Like I said, multiple output feature classes are not supported right now. 
Can you combine your whole process into a single model without using sub-models?  Maybe you should consider using a python script instead of doing a pure model builder process.
0 Kudos
HeatherLizama
New Contributor
Since I have other iterators (ie/ iterate feature class), I cannot put the models into one process. Yes, python is an option, but the models are already built. It would take a lot more work to get this running in python.

Thanks for all of your help! I will give the zipping option a try.
0 Kudos
HeatherLizama
New Contributor
Hi Andrew,

I initiated and tested the zip tool. See attached model. It works well on desktop and it did publish to a service without errors. Can you or anyone else see why this service is failing?

Info about model:

Enter a Graphical Boundary or a Boundary Feature Class: Data Type - Feature Set

Sel_Bound: Managed - in_memory\Sel_Bound

Bound_Lyr: in_memory\Bound_Lyr_%Model_Value%

Parcel: %scratchworkspace%\Scratch.gdb\Output\Parcel_%Model_Value%

InputFolderString: \\\GEOSERVER1\ServerData\Model1a\Scratch (it crashes on desktop without the extra \ ) Data Type - String

Calculate Value: Expression - "%InputFolderString%", Data type - Folder

Zip Folder script - Input Data Type: Any Value, Output Data Type: file

Enter the location to place the Output Zip File (must be named *.zip): %scratchworkspace%\scratch.zip

Thanks!
0 Kudos
AndrewChapkowski
Esri Regular Contributor
Can you post your model with sample data?

Thanks


Hi Andrew,

I initiated and tested the zip tool. See attached model. It works well on desktop and it did publish to a service without errors. Can you or anyone else see why this service is failing?

Info about model:

Enter a Graphical Boundary or a Boundary Feature Class: Data Type - Feature Set

Sel_Bound: Managed - in_memory\Sel_Bound

Bound_Lyr: in_memory\Bound_Lyr_%Model_Value%

Parcel: %scratchworkspace%\Scratch.gdb\Output\Parcel_%Model_Value%

InputFolderString: \\\GEOSERVER1\ServerData\Model1a\Scratch (it crashes on desktop without the extra \ ) Data Type - String

Calculate Value: Expression - "%InputFolderString%", Data type - Folder

Zip Folder script - Input Data Type: Any Value, Output Data Type: file

Enter the location to place the Output Zip File (must be named *.zip): %scratchworkspace%\scratch.zip

Thanks!
0 Kudos