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?
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.
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.
Its available in assignment operator in a server action.
Ah, right, thanks. I had never seen that before :).
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
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
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
Saurabh
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.