<?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 Re: Maintain Service Draft file after running &amp;quot;Stage Service&amp;quot; tool. in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/maintain-service-draft-file-after-running-amp-amp/m-p/53600#M1864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Follow this thread for more details:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/80680-How-to-publish-a-feature-service-to-ArcGIS-Online-from-an-mxd-USING-PYTHON" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/80680-How-to-publish-a-feature-service-to-ArcGIS-Online-from-an-mxd-USING-PYTHON&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Apr 2013 13:46:04 GMT</pubDate>
    <dc:creator>TiagoRibeiro</dc:creator>
    <dc:date>2013-04-22T13:46:04Z</dc:date>
    <item>
      <title>Maintain Service Draft file after running &amp;amp;quot;Stage Service&amp;amp;quot; tool.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/maintain-service-draft-file-after-running-amp-amp/m-p/53598#M1862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my model I have a "Stage Service" tool. The propose of the model is to push data into ArcGIS Online every week. This model will run automatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As it says in documentation, the draft file is deleted after the tool runs, but I wanted to preserve this file so that it can be used again. It's the only step missing on this model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can get around it by creating a python tool that verifies if the file exists, and if doesn't, copy it from another directory, but I was wondering if there's an "out-of-the-box" way to do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help will be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Apr 2013 07:26:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/maintain-service-draft-file-after-running-amp-amp/m-p/53598#M1862</guid>
      <dc:creator>TiagoRibeiro</dc:creator>
      <dc:date>2013-04-17T07:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Maintain Service Draft file after running "Stage Service" tool.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/maintain-service-draft-file-after-running-amp-amp/m-p/53599#M1863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I kinda get around it. What I did is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I Created this custom Python Tool...&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

mapDoc = arcpy.GetParameterAsText(0) 
service = arcpy.GetParameterAsText(1)
sddraft = 'C:\\GISData\\NIEA\\{}.sddraft'.format(service)

# create service definition draft
analysis = arcpy.mapping.CreateMapSDDraft(mapDoc, sddraft, service, 'MY_HOSTED_SERVICES')

# stage and upload the service if the sddraft analysis did not contain errors
if analysis['errors'] == {}:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SetParameterAsText(0, sddraft)
else: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SetParameterAsText(0, sddraft)
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;... and the Service Definition Draft is created without a hitch. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I'm trying to pass the output SD draft to the Stage Service (Server) tool, inside the model, but I haven't yet been able to pass the output of the custom tool to the Stage Service tool. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The stage tool is expecting a file type input parameter, but even though I set the output of the custom tool to be a file, it's still not working... &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There's a way around it, but it's not very "elegant". Use a preexisting SD Draft as the input of Stage Service tool, and have the custom tool just replace that sddraft file... any other ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:03:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/maintain-service-draft-file-after-running-amp-amp/m-p/53599#M1863</guid>
      <dc:creator>TiagoRibeiro</dc:creator>
      <dc:date>2021-12-10T22:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Maintain Service Draft file after running "Stage Service" tool.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/maintain-service-draft-file-after-running-amp-amp/m-p/53600#M1864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Follow this thread for more details:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/80680-How-to-publish-a-feature-service-to-ArcGIS-Online-from-an-mxd-USING-PYTHON" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/80680-How-to-publish-a-feature-service-to-ArcGIS-Online-from-an-mxd-USING-PYTHON&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 13:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/maintain-service-draft-file-after-running-amp-amp/m-p/53600#M1864</guid>
      <dc:creator>TiagoRibeiro</dc:creator>
      <dc:date>2013-04-22T13:46:04Z</dc:date>
    </item>
  </channel>
</rss>

