Is it possible to use iteratos in a model as a GP Service?

1505
3
10-20-2014 08:26 AM
DiegoLlamas
Esri Contributor

Hi,

I am creating a model that use an iterator. I've been looking if it is possible to use an iterator in a geoprocessing service. I found out that iterator cannot been used in scripting but it does not say anything about a service.

When I checked geoprocessing services help I did not found anything about iterators, I just need to know if it is able to use it as part of a model on a service. Do you know something about it?

Have a great day!

Diego Llamas

0 Kudos
3 Replies
curtvprice
MVP Esteemed Contributor

Models should generally run fine in a service, even if they have iterators.

The developers (apparently) found it very difficult to translate model builder iterators to code. That's why they don't export to scripting.

You can do loops in Python scripting that do the same thing as ModelBuilder iterators (and more), but this involves some knowledge of Python and arcpy list functions.

0 Kudos
DiegoLlamas
Esri Contributor

Hi Curtis, Thanks for your help!

I am working with 3 iterators, but as you know we cannot use 2 iterators in the same model, so what I did was to create two different models and add this two to a third one. So I am working a model in a model and when I do this model as a service, It just stay there, do not respond. so a model in a model can work as a service?

Have a nice day!

DLL

0 Kudos
curtvprice
MVP Esteemed Contributor

The answer is yes, you can published nested models.I haven't tried it myself, but they say it can be done. Video demo here:

Analysis and Geoprocessing | ArcGIS Video

0 Kudos