172
Views
8
Comments
Solved
scheduling timers
Application Type
Traditional Web

I've a scenario whereas I want to create a page, which allows the users to schedule the tasks using timer. Is there any provision to implement it by default or do we need to install any forge component for the same?

UserImage.jpg
vikas sharma
Champion
Solution

Hi Xavior, 

If you want to schedule the timer programmatically then can use the schedule variable for the timer.

As you mentioned that you want to schedule the tasks, so if all tasks are same means logic is going to be same. So you can create a single timer.  Then schedule the timer for latest task. Once this task completed at the end pick next latest schedule and schedule the timer accordingly.

But in this you have to manage some complexity of overlapping schedule when timer is already running or you can create a new timer for this.

regards.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Vikas,

Where do you see the "Schedule" property? I only see the "WakeXxxx" action below a timer in the tree, and my Timers node has a folder icon, not a timer icon.

UserImage.jpg
vikas sharma
Champion

Its available in assignment operator in a server action.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Ah, right, thanks. I had never seen that before :).

2020-11-13 07-48-15
Khuong Truong

Hi @Xavior ,

I think you can follow this post https://www.outsystems.com/forums/discussion/81398/timers/. There is a similar case to your case and there is a link (https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Processes/Timer) to document about timer.

You may find idea how to programmatically update scheduler for a timer.

Regards,

Khuong

2021-12-23 04-28-09
Navneet Sharma

Hello @Xavior,

For knowing more about schedule the tasks using timer 

you can refer this videos Tutorials 

https://www.youtube.com/watch?v=maJgEZLfk9c

I hope this will help you


Thanks & Regards

Navneet Sharma


 

UserImage.jpg
Saurabh Shivananda Prabhu Chimulkar

Hi Xavior,

As you will be aware that Timers are used for asynchronous background processes, and on any environment at max 3 timers can run in parallel (configurable), however only one instance of the Timer can run at a time. This is managed by OutSystems Scheduler Service.

So in case you want multiple Tasks having the same schedule run at same time, then there will be some delay based on the processing to be done for each Task.

I will suggest you to have a Table to queue all your Tasks along with schedule of when to run them, and you can programmatically wake a Timer which will process the entries in the queue whose schedule is reached. You can go a step further and launch a Process from the Timer to do the processing if you need high throughput (multiple  tasks having same schedule).

Below are few useful links to Understand the Timers and best practices around it better:

Outsystems Documentation - This is Deep Dive on How Timers work

https://kilianhekhuis.medium.com/timers-and-when-they-run-5614d683c973

https://www.outsystems.com/training/lesson/1749/odc-2018-heavy-timers


Regards,

Saurabh

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Xavior,

If you want to schedule a timer for running directly when the user presses a button, that's easy: just call the timer's Wake action, which you can find below the timer in the Processes tree:

If you want to schedule a timer for running at a later date/time, that's a lot more complex, as you'll have to create and save a schedule. This is perfectly possible, but non-trivial.

UserImage.jpg
vikas sharma
Champion
Solution

Hi Xavior, 

If you want to schedule the timer programmatically then can use the schedule variable for the timer.

As you mentioned that you want to schedule the tasks, so if all tasks are same means logic is going to be same. So you can create a single timer.  Then schedule the timer for latest task. Once this task completed at the end pick next latest schedule and schedule the timer accordingly.

But in this you have to manage some complexity of overlapping schedule when timer is already running or you can create a new timer for this.

regards.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Vikas,

Where do you see the "Schedule" property? I only see the "WakeXxxx" action below a timer in the tree, and my Timers node has a folder icon, not a timer icon.

UserImage.jpg
vikas sharma
Champion

Its available in assignment operator in a server action.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Ah, right, thanks. I had never seen that before :).

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.