Hi,
I am doing batch processing for which I want to use timer in automatic activity. similar to the solution mentioned in the below thread. But I didnt get how to signal the automatic activity that timer has finished the processing and has ended. The automatic activity in my code is not launched by updating or creating entity its manually triggered.
https://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/BPT_-_Automatic_Activities_Timeout
If its possible can anyone please share the flow which is mentioned in this resolution.
hi Kaustubh,
you could use something like this:
Create a timer that will update your record to e.g. a FinishedState.
in you BPT, add a Wait Step and let it wait until your record has been updated to this FinishedState. So it will continue after the Timer changed your records.
regards, Hans
Hi Hans,
Thanks for the reply. But here I want to do batch processing of records and the approach you suggested is for one record only.
I am new to the BPT process so please help me here
In my logic I want to process more than 500 records. Is it possible in Outsystems that fetch the top 50 records in automatic activity process it in timer and once the timer ends for those 50 records again fetch next 50 records which are not processed in the automatic activity and run the timer again till all records are processed?
I doubt if you should use BPT in this case, since a Timer can fetch the top 20 as well, together with timeout validations you might have a good solution.
If you want to combine it with BPT, you can create two entities, one entity with the BatchNumber and one with the 50 records to process. Than you can wait for Entity One.Status until it is set to Finished.
but of course you got some delays in starting / resuming BPT and the Timer as well.
Can you elaborate a bit more about what you want to achieve?
In my web app there is a functionality that users can upload the records which needs to be processed and for this I am using automatic activity to process the data which has a timeout of 5 mins. currently users can upload max 100 records for processing where the timeout issue of automatic activity doesn't occur but now the requirement is that they want to upload more than 500 records for processing where the automatic activity gets timed out and it gets stuck into loop.
Regarding the first approach with only timers, if I implement this how will it work if multiple users upload the data for processing at same time. Timers would be queued up. Is this the best possible solution? or what can be the other approach here to resolve this issue.
Timers would be queued up, that won't happen because there is only one timer which processes the records. You just can have a Timer that will look at the entities which records to process and processes those records, perhaps group by the user that created those records. When having a master entity that contains the UserId and a Status Field, than that field can be used to inform the user that the records are processed.
yes the master entity contains userId and status field, so in timer we can pass userid and only those records will be fetched to process which are uploaded by that particular userId. But in scenario like if multiple users upload the data to process at same time the timers would be queued up right? In my solution I want to trigger the timer process as soon as the user uploads the records. so in this case multiple requests would be made at same time to wake timer if multiple users are trying to upload at same time
in that case, the BPT must start the wake up of the timer. The timer will process records per userid and when there are records from another user to process, awakes himself. there is just 1 timer.
Perhaps using light-bpt for the batch processing per user is more suitable to your needs? it has a timeout of 3 minutes, so you really have to take care of timeouts. no bulk processing, but breaking it up in small steps and process the small steps really fast.