80
Views
3
Comments
processing data using timers

Hello,

Could anyone provide a sample code/oml for processing large datasets using timers, along with some theoretical explanation of how to do it?

If there are multiple ways to achieve this, please suggest them as well."

 


i want to understand what is written in those 2 if conditions

2025-03-11 05-02-41
Ragu Vasu
AI Generated

Hi Suresh Kumar,

Good Morning.

Timer:

    A Timer is an OutSystems tool that allows executing application logic periodically on a scheduled time. These are also known as batch jobs.

    Different Timers can be executed at the same time, but the same Timer never has more than one execution at a time.   

Using Timers:

    You can use Timers to execute asynchronous logic in your OutSystems application. This is useful to execute batch tasks like sending emails at a predetermined time or to execute logic to configure an application after its deployment.

Timers Timeout

    The timeout of a Timer is set by default to 20 minutes, but you can change it by setting the Timeout in Minutes property of the timer.

Here's a simplified Steps of the logic you're describing:

1) Set Timer Timeout: The default timeout is 20 minutes, but you can adjust this to a custom timeout (e.g., 10 minutes). This is used to ensure that the timer is restarted before it hits the timeout limit. Essentially, this would prevent the timer from being interrupted by a timeout before completing its logic.

2) Fetch Records: Retrieve records from an entity (e.g., 1000 records) to process. This step could involve querying a database or API for the necessary data.

3) Process Each Record: Iterate through each record and process it. Update the status or flag of the record to mark it as processed, ensuring no record is processed more than once.

4) Check Timeout: Evaluate if the timer has exceeded the set timeout. If the timeout is near, restart the timer to avoid an interruption. This ensures that the timer doesn't end prematurely.

5) Check for More Records: If more records need processing, redirect to Step 2 and continue the process. If no more records are left to process, the timer ends and completes the job.

This is useful in scenarios like batch processing, ensuring tasks that take longer than the typical execution time don't fail, and minimizing the risk of duplicate processing.

For further more details, kindly refer this link for timers.

Thanks.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2025-05-31 09-56-11
TheSubuIyer
Champion

The 2 if condition are as below

Timeout passed

  • In the start of the action you are setting the time out say 10 mins. That is the maximum time you want the timer to run in one instance.
  • You do this by setting timeout=addmins(currdatetime(),10)
  • In this if you check if the time when you started the timer and when your reached this If the time out has exceeded.
  • Eg currdatetime()>timeout if true to rewake the timer to initiate a nes instance of the timer.

The second is more records to Process 

  • Lets say you had 1200 records where the timer was to be processed.
  • You do 500 records per loop.
  • Here you would check the records remain to be updated. 
  • The first 2 times it would be 700 and 200 there for >0 hence true and return to the loop.
  • The third time it will exit.

Hope that helps.

Regards 

Subu

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi @Suresh kumar ,

Watch this explanatory video on Heavy Timers, which covers best practices for using them effectively: https://learn.outsystems.com/training/journeys/odc-2018-development-548/-odc-2018-heavy-timers/o11/2480 .

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