<?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 geoprocessing service with result map service in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/geoprocessing-service-with-result-map-service/m-p/99113#M2286</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have created a geoprocessing service from the results of a Grouping Analysis (new at 10.1).&amp;nbsp; I included a result map serivce in my gp service, but I have not been able to get it to show up in my web app.&amp;nbsp; I can take the url built using the jobid and paste it into a web browser and see the map service, so I know it is being created.&amp;nbsp; The code from my geoprocesser' jobComplete handler is below.&amp;nbsp; Any help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Randy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;private function gp_jobCompleteHandler(event:GeoprocessorEvent):void
{
 if (event.jobInfo.jobStatus == JobInfo.STATUS_SUCCEEDED)
 {
&amp;nbsp; gp.getResultData(gp.submitJobLastResult.jobId, "Output_Feature_Class");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; var resultMapUrl : String = "http://localhost:6080/arcgis/rest/services/GroupingAnalysis_102100_2/MapServer/jobs/" + event.jobInfo.jobId;
&amp;nbsp; var resultMapServiceLayer : ArcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(resultMapUrl);
&amp;nbsp; //resultMapServiceLayer.id = "gpLayerResult";
&amp;nbsp; resultMapServiceLayer.visibleLayers = new ArrayList(['0']);
&amp;nbsp; map.addLayer(resultMapServiceLayer);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 }
 else
 {
&amp;nbsp; showErrorMessage(event.jobInfo.jobStatus);
&amp;nbsp; CursorManager.removeBusyCursor();
 }
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Nov 2012 15:55:56 GMT</pubDate>
    <dc:creator>RandallBrown</dc:creator>
    <dc:date>2012-11-05T15:55:56Z</dc:date>
    <item>
      <title>geoprocessing service with result map service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/geoprocessing-service-with-result-map-service/m-p/99113#M2286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have created a geoprocessing service from the results of a Grouping Analysis (new at 10.1).&amp;nbsp; I included a result map serivce in my gp service, but I have not been able to get it to show up in my web app.&amp;nbsp; I can take the url built using the jobid and paste it into a web browser and see the map service, so I know it is being created.&amp;nbsp; The code from my geoprocesser' jobComplete handler is below.&amp;nbsp; Any help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Randy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;private function gp_jobCompleteHandler(event:GeoprocessorEvent):void
{
 if (event.jobInfo.jobStatus == JobInfo.STATUS_SUCCEEDED)
 {
&amp;nbsp; gp.getResultData(gp.submitJobLastResult.jobId, "Output_Feature_Class");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; var resultMapUrl : String = "http://localhost:6080/arcgis/rest/services/GroupingAnalysis_102100_2/MapServer/jobs/" + event.jobInfo.jobId;
&amp;nbsp; var resultMapServiceLayer : ArcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(resultMapUrl);
&amp;nbsp; //resultMapServiceLayer.id = "gpLayerResult";
&amp;nbsp; resultMapServiceLayer.visibleLayers = new ArrayList(['0']);
&amp;nbsp; map.addLayer(resultMapServiceLayer);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 }
 else
 {
&amp;nbsp; showErrorMessage(event.jobInfo.jobStatus);
&amp;nbsp; CursorManager.removeBusyCursor();
 }
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2012 15:55:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/geoprocessing-service-with-result-map-service/m-p/99113#M2286</guid>
      <dc:creator>RandallBrown</dc:creator>
      <dc:date>2012-11-05T15:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: geoprocessing service with result map service</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/geoprocessing-service-with-result-map-service/m-p/99114#M2287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have created a geoprocessing service from the results of a Grouping Analysis (new at 10.1).&amp;nbsp; I included a result map serivce in my gp service, but I have not been able to get it to show up in my web app.&amp;nbsp; I can take the url built using the jobid and paste it into a web browser and see the map service, so I know it is being created.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The source code for the FlexViewer's Geoprocessing widget can be really helpful when trying to create API applications using geoprocessing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For your case, see &lt;/SPAN&gt;&lt;A href="https://github.com/ArcGIS/ArcGISViewerForFlex/blob/master/src/widgets/Geoprocessing/GeoprocessingWidget.mxml" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/ArcGIS/ArcGISViewerForFlex/blob/master/src/widgets/Geoprocessing/GeoprocessingWidget.mxml&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private function processResultImageLayer(paramName:String):void
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;var lastExecutedJob:JobInfo = gp.submitJobLastResult;&lt;/STRONG&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;var resultImageLayer:GPResultImageLayer = gp.getResultImageLayer(lastExecutedJob.jobId, paramName);&lt;/STRONG&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; resultImageLayer.id = paramName;
&amp;nbsp;&amp;nbsp;&amp;nbsp; resultImageLayer.name = ("hiddenLayer_" + paramName);
&amp;nbsp;&amp;nbsp;&amp;nbsp; resultImageLayersOnMap.push(resultImageLayer);
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;map.addLayer(resultImageLayer);&lt;/STRONG&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerOrderer.orderLayers();
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:10:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/geoprocessing-service-with-result-map-service/m-p/99114#M2287</guid>
      <dc:creator>BjornSvensson</dc:creator>
      <dc:date>2021-12-11T06:10:34Z</dc:date>
    </item>
  </channel>
</rss>

