2

I have a model designded in ModelBuilder to process raster datasets. It embraces a whole bunch of processes such as raster calcualtion, BlockStatistics and Kriging. I am wondering how I can put in success validation for each of the process in the model in ModelBuilder to detect if the process has successfully run.

Is it possible without converting the model to python?

The Model will be eventually published as Geoprocessing Service by ArcGIS Server 10.1 so that the web browse calls the service and then gets a Result as the output in JSON if the Model rans successfully or on which process it failed. The success validation component should be part of the Model and generate result as parameter of the model.

3 Answers 3

1

I use code like this within my Python scripts that get exposed as Geoprocessing Services.

arcpy.SetParameterAsText(9, "SUCCEEDED")

or

arcpy.SetParameterAsText(9, "FAILED")

I think the ModelBuilder equivalent would be to use an output parameter.

It shows up at the top of the returned JSON as something like this (for failure):

{
  "results" : [
    {
      "paramName" : "MapRequestResult",
      "dataType" : "GPString",
      "value" : "FAILED"
    }
  ],
  "messages" : [
4
  • Thanks PolyGeo. The "SetParameterAsText" you suggested requires the model to be exported to Python before any custom codes can be inserted. Output parameter is also for a Python script. Is there any equivalent to "arcpy.SetParameterAsText" in Model Builder?
    – alextc
    Commented Jul 29, 2013 at 23:45
  • I think you can create a model variable, that you set to be a parameter, and then on the model's parameters tab you set its direction to be output.
    – PolyGeo
    Commented Jul 30, 2013 at 0:46
  • Hi PolyGeo. The variable can only be set to Required or Optional, no Output can be selected on the Parameter tab
    – alextc
    Commented Jul 30, 2013 at 5:29
  • The output option is also called Derived - this page on Setting script tool parameters talks about it.
    – PolyGeo
    Commented Jul 30, 2013 at 7:26
1

You can creat a model report :

To create a model report, do the following: Steps:

  1. Choose from the menu by clicking Model > Report.
  2. Choose either Report on your screen or Save it to a file as the way you will view the report.
  3. If you choose to save, navigate to the location you want to save the report, type in a new name, then click Save.

    Reports are saved to an XML file. You can view this file in your browser, such as Internet Explorer.

or you can use validation script By adding Python code You can provide custom behavior for your script tool dialog box, such as enabling and disabling parameters, providing default values, and updating string keywords.

1
  • Thanks Geog for the info. I think I might have mis-expressed my idea. My plan was to eventually expose the model as a geoprocessing service so that the service pvovides a result in JSON or XML so that the client knows on which process the model failed.
    – alextc
    Commented Jul 29, 2013 at 6:12
-1

Just bring up the results window. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Using_the_Results_window/002100000013000000/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.