<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Delayed Task and Expiry Tasks timing is not correct if the interval is smaller 60 seconds</title><link>https://answers.axonivy.com/questions/3744/delayed-task-and-expiry-tasks-timing-is-not-correct-if-the-interval-is-smaller-60-seconds</link><description>&lt;p&gt;Hi Axon.ivy Team,&lt;/p&gt;
&lt;p&gt;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 &lt;strong&gt;may be 30 seconds or less&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;However, we discovered that the duration &lt;strong&gt;does not work&lt;/strong&gt; if it is smaller than 60 seconds. I had done our homework a little bit and discovered that the &lt;code&gt;WorkflowJob&lt;/code&gt; 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 &lt;code&gt;WorkflowManager&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I assumed this was done &lt;em&gt;by design&lt;/em&gt; 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 &lt;code&gt;SystemTask.SearchJob.Interval&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Is there any recommended ways to overcome this limitation?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In our system, we want to communicate to a 3rd party system, namely ABC, via its RESTful API.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;Our system then have to poll ABC's API for result &lt;strong&gt;asynchronously&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;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 &lt;code&gt;30S&lt;/code&gt;. For triggering a retry, the process itself then send a new Signal with an additional delay duration.&lt;/p&gt;
&lt;p&gt;What would be your suggestion to implement such a use case then?&lt;/p&gt;
&lt;p&gt;Bump this up!&lt;/p&gt;
&lt;p&gt;Regard&lt;/p&gt;
&lt;p&gt;Jack&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/3744/delayed-task-and-expiry-tasks-timing-is-not-correct-if-the-interval-is-smaller-60-seconds" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 04 Apr 2019 02:54:41 -0400</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/3744/delayed-task-and-expiry-tasks-timing-is-not-correct-if-the-interval-is-smaller-60-seconds/3762</link><description>&lt;p&gt;To me this sounds like the perfect use-case for a 'Wait' intermediate event:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;once the user invoked the ABC api the element can poll at your pre-defined intervall : &lt;a href="https://developer.axonivy.com/doc/latest/PublicAPI/ch/ivyteam/ivy/process/intermediateevent/IProcessIntermediateEventBeanRuntime.html#setPollTimeInterval-long-"&gt;https://developer.axonivy.com/doc/latest/PublicAPI/ch/ivyteam/ivy/process/intermediateevent/IProcessIntermediateEventBeanRuntime.html#setPollTimeInterval-long-&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;after the 'Wait' event was received you can continue with a normal task (either signaled or standard)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I know the samples and API is dated: but for instance the &lt;code&gt;ch.ivyteam.ivy.process.intermediateevent.beans.FileIntermediateEventBean&lt;/code&gt; contains a sample...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Thu, 04 Apr 2019 02:54:41 -0400</pubDate><guid>https://answers.axonivy.com/questions/3744/delayed-task-and-expiry-tasks-timing-is-not-correct-if-the-interval-is-smaller-60-seconds/3762</guid></item><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/3744/delayed-task-and-expiry-tasks-timing-is-not-correct-if-the-interval-is-smaller-60-seconds/3745</link><description>&lt;p&gt;Hi Jack&lt;/p&gt;
&lt;p&gt;In workflow processes delay and expiry times are normally weeks, days or hours. &lt;/p&gt;
&lt;p&gt;What is your use case that you need to set this to seconds? Are you sure you use the right concept for your use case?&lt;/p&gt;
&lt;p&gt;There is currently no workaround for this.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Reto Weiss, Axon.ivy Support&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Mon, 25 Mar 2019 15:46:34 -0400</pubDate><guid>https://answers.axonivy.com/questions/3744/delayed-task-and-expiry-tasks-timing-is-not-correct-if-the-interval-is-smaller-60-seconds/3745</guid></item></channel></rss>