<?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: JavaScript: GP Task being called multiple times in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-gp-task-being-called-multiple-times/m-p/744508#M68879</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I worked this out. The on-click event that called the GP tool was being wired as part of another button (Button B), so if Button B was clicked multiple times in one session, multiple on-click events were set up and would trigger simultaneously. Very annoying but a good lesson in code management!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Jan 2015 19:15:46 GMT</pubDate>
    <dc:creator>NatalieScott1</dc:creator>
    <dc:date>2015-01-12T19:15:46Z</dc:date>
    <item>
      <title>JavaScript: GP Task being called multiple times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-gp-task-being-called-multiple-times/m-p/744507#M68878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a GP task that is called within a JS webpage. When I click the button to run the task, it frequently starts up multiple version of the task as shown in the following console logs:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(for context, FP13 is the js page; line 927 is "console.log(jobInfo.jobStatus);" and the '2' or other number that sometimes occurs in front of the output indicates that that statement has been console.logged that many times in succession)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;2FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobSubmitted&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;2FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;2FP13.js:927&lt;STRONG&gt; esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;2FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927&lt;STRONG&gt; esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 &lt;STRONG&gt;esriJobSubmitted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;31FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobFailed&lt;/P&gt;&lt;P&gt;FP13.js:932 esriJobFailed&lt;/P&gt;&lt;P&gt;19FP13.js:927 esriJobExecuting&lt;/P&gt;&lt;P&gt;FP13.js:927 esriJobSucceeded&lt;/P&gt;&lt;P&gt;FP13.js:932 esriJobSucceeded (etc etc)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you can see that the task was sumbitted multiple times and is running many of these concurrently. Some of them succeed, some of them fail. There is no consistency to the number of times a job is sumbitted - it might be once, twice, or any number. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The GP task is called with: gpEvent.submitJob(paramsEvent, eventCompleteCallback, eventStatusCallback);&lt;/P&gt;&lt;P&gt;The parameters are unlikely to be the problem because doesn't behave consistently even when the parameters are identical.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone come across this behaviour before? And how do I fix it? &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running the GP service from a 10.2.1 server and testing primarily in Chrome using the 3.11 API build.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;Natalie&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 22:17:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-gp-task-being-called-multiple-times/m-p/744507#M68878</guid>
      <dc:creator>NatalieScott1</dc:creator>
      <dc:date>2015-01-08T22:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript: GP Task being called multiple times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-gp-task-being-called-multiple-times/m-p/744508#M68879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I worked this out. The on-click event that called the GP tool was being wired as part of another button (Button B), so if Button B was clicked multiple times in one session, multiple on-click events were set up and would trigger simultaneously. Very annoying but a good lesson in code management!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 19:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/javascript-gp-task-being-called-multiple-times/m-p/744508#M68879</guid>
      <dc:creator>NatalieScott1</dc:creator>
      <dc:date>2015-01-12T19:15:46Z</dc:date>
    </item>
  </channel>
</rss>

