AnsweredAssumed Answered

Stop/Continue in nested submodel (with iterators)

Question asked by HCarlos on Sep 16, 2011
Latest reply on Sep 22, 2011 by geonetadmin
Hello all!
I have a frequency table with a with a bunch of different attributes (destinations).  I want to iterate through the rows of the table, and then check that a select list of the attributes have a value >0, if so, I then want to make a selection from a related shapefile and draw a convex hull around the selection.  If any of the list of attributes = 0, then I do nothing and move on to the next row of the frequency table.

To do this, I set up a submodel with iterate field values and calculate value to check the list of attributes.  I use "stop" if one of the attributes = 0, otherwise continue.  In the main model, I Iterate Row Selection on the frequency table and then send the selected row to the submodel.  I then have the results of the submodel (the "continue") as a precondition for selecting from the shapefile and drawing the convex hull.

Two problems:  1) my calculate value always returns "true" even if the attribute = 0
2) Even when the submodel finds all the attributes > 0, the next step in the main model won't run because "the precondition is false".

I've attached the model, submodel the calculate value code is as follows:

getVal("%DestName%")

def getVal(intValue):
  if intValue >= 1:
    return "TRUE"
  else:
    return "FALSE"

Data Type is Boolean

Attachments

Outcomes