<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ModelBuilder with precondition in batch mode fail in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-with-precondition-in-batch-mode-fail/m-p/169412#M5684</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;SPAN&gt;I have a model that recalculates and applies a new spatial index to a feature class which came from the discussion &lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank"&gt;Batch" rel="nofollow" target="_blank"&amp;gt;http://forums.arcgis.com/threads/3837-Batch-recalculate-spatial-index?p=32966#post32966]Batch&lt;/A&gt;&lt;SPAN&gt; recalculate spatial index.&amp;nbsp; One issue I had with it is that it would fail if the feature class didn't have any features.&amp;nbsp; When running a batch, this would suck as it would come across an empty feature class then stop.&amp;nbsp; So I added a precondition to use Get Count to check that the number of rows wasn't 0.&amp;nbsp; Works great on a single class.&amp;nbsp; If it's empty, it indicates that the precondition fails and skips the spatial index stuff instead of throwing an error.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, run this in batch mode with two feature classes, one with features and one without.&amp;nbsp; If the one without features is first, then the precondition fails on both and nothing happens.&amp;nbsp; If the one with features is first, then the precondition passes and both run which causes it to error on the empty class.&amp;nbsp; You would think that running in batch means run the model X amount of times with the different input values.&amp;nbsp; But it would appear there is something that crosses between inputs that causes a precondition result from one input to be applied to all input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is a test toolbox with the model in it.&amp;nbsp; Has anybody else noticed this issue?&amp;nbsp; Is there some option or setting that is missing that would allow this to work?&amp;nbsp; In the end, I created a python script that does the same thing and that works in batch mode just fine.&amp;nbsp; Ran into some issues with python as well, but that's a discussion for another day.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Sep 2013 20:09:32 GMT</pubDate>
    <dc:creator>BillyBuerger</dc:creator>
    <dc:date>2013-09-05T20:09:32Z</dc:date>
    <item>
      <title>ModelBuilder with precondition in batch mode fail</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-with-precondition-in-batch-mode-fail/m-p/169412#M5684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;SPAN&gt;I have a model that recalculates and applies a new spatial index to a feature class which came from the discussion &lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank"&gt;Batch" rel="nofollow" target="_blank"&amp;gt;http://forums.arcgis.com/threads/3837-Batch-recalculate-spatial-index?p=32966#post32966]Batch&lt;/A&gt;&lt;SPAN&gt; recalculate spatial index.&amp;nbsp; One issue I had with it is that it would fail if the feature class didn't have any features.&amp;nbsp; When running a batch, this would suck as it would come across an empty feature class then stop.&amp;nbsp; So I added a precondition to use Get Count to check that the number of rows wasn't 0.&amp;nbsp; Works great on a single class.&amp;nbsp; If it's empty, it indicates that the precondition fails and skips the spatial index stuff instead of throwing an error.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, run this in batch mode with two feature classes, one with features and one without.&amp;nbsp; If the one without features is first, then the precondition fails on both and nothing happens.&amp;nbsp; If the one with features is first, then the precondition passes and both run which causes it to error on the empty class.&amp;nbsp; You would think that running in batch means run the model X amount of times with the different input values.&amp;nbsp; But it would appear there is something that crosses between inputs that causes a precondition result from one input to be applied to all input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is a test toolbox with the model in it.&amp;nbsp; Has anybody else noticed this issue?&amp;nbsp; Is there some option or setting that is missing that would allow this to work?&amp;nbsp; In the end, I created a python script that does the same thing and that works in batch mode just fine.&amp;nbsp; Ran into some issues with python as well, but that's a discussion for another day.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 20:09:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-with-precondition-in-batch-mode-fail/m-p/169412#M5684</guid>
      <dc:creator>BillyBuerger</dc:creator>
      <dc:date>2013-09-05T20:09:32Z</dc:date>
    </item>
  </channel>
</rss>

