Questions Tagged With taskhttps://answers.axonivy.com/tags/task/?type=rss&user=vagabondquestions tagged <span class="tag">task</span>enMon, 25 Mar 2019 06:31:06 -0400Delayed Task and Expiry Tasks timing is not correct if the interval is smaller 60 secondshttps://answers.axonivy.com/questions/3744/delayed-task-and-expiry-tasks-timing-is-not-correct-if-the-interval-is-smaller-60-seconds<p>Hi Axon.ivy Team,</p> <p>In our project, we have several use cases that we would like to use the Delayed Tasks or Expiry Tasks. Depends on the business needs, our delayed or expiration duration <strong>may be 30 seconds or less</strong>.</p> <p>However, we discovered that the duration <strong>does not work</strong> if it is smaller than 60 seconds. I had done our homework a little bit and discovered that the <code>WorkflowJob</code> which was the main module used to resolve expired or delayed tasks is scheduled to run periodically on every 60 seconds. This was done in <code>WorkflowManager</code>.</p> <p>I assumed this was done <em>by design</em> but it took me by surprise because I could not find anywhere mentioning this limitation. The interval, 60 seconds, is hardcoded and is not configurable like the <code>SystemTask.SearchJob.Interval</code>.</p> <p>Is there any recommended ways to overcome this limitation?</p> <p><strong>UPDATE</strong></p> <p>In our system, we want to communicate to a 3rd party system, namely ABC, via its RESTful API.</p> <ul> <li>The process starts when a User triggers a designated action on the UI. We then call the ABC's API to initiate a process on their system.</li> <li>Our system then have to poll ABC's API for result <strong>asynchronously</strong>.</li> <li>The ABC API requires that we have to poll for result at least after 30 seconds from the time the first request has been sent.</li> <li>We want to have at max 3 attempts to call ABC's API for checking the result. Each time will have an additional delay of 10 seconds.</li> <li>At the same time, the User UI may be also polling for the result. It is not required that they have to keep the UI open.</li> </ul> <p>Having the above requirements, we are using Signal to trigger the polling to ABC's API asynchronously. The Signal process makes uses of SYSTEM TaskElement whose DelayDuration set to <code>30S</code>. For triggering a retry, the process itself then send a new Signal with an additional delay duration.</p> <p>What would be your suggestion to implement such a use case then?</p> <p>Bump this up!</p> <p>Regard</p> <p>Jack</p>vagabondMon, 25 Mar 2019 06:31:06 -0400https://answers.axonivy.com/questions/3744/delayed-task-and-expiry-tasks-timing-is-not-correct-if-the-interval-is-smaller-60-secondstaskworkflow