Queues to know last transaction

I have a dispatcher which adds items to Queue…say it added 10 Transactions…
i have 3 Runners which the Performer Bot is going to run… how to know the last transaction…
after 10th transaction is done… we need to send summary report in an email… so ONLY one email has to go at the end of the process… irrespective whichever machine is processing the last transaction it has to send
Thank you

@rajkumar.thyagarajan

Use Get Queue Item activity at the end in Perfomer process and check any items whose status in New or Inprogess. If the count is 0 then you can send mail else not.

1 Like

The Get Queue Item activity relies on the dispatcher bot running the entire time the 3 ‘runner’ bots are processing, which in my opinion isn’t ok. It also means that if two dispatcher bots were ran concurrently then the reporting could be all messed up.

Instead I suggest looking into persistence activities. (UiPath.Persistence.Activities)
Update your dispatcher bot so that instead of using the ‘Add Queue Item’ activity is uses the
‘Add Queue Item And Get Reference’ activity.

Add all the QueueItemData objects to a list and create a Parallel For each Loop that iterates over each of them and use the ’ Wait For Queue Item And Resume’ activity in it.

This will cause the dispatcher bot to suspend once it creates all the queue items, freeing up the machine / licence for other tasks, and will wake up and complete the rest of the workflow once all the queue Items are complete. You’ll have all the completed queue items from the wait activity so can use that to build your report.

1 Like

Thank you…
Actually we have only one VM for Dispatcher… it scheduled on the dedicated machine runs once per day…
but Performer will have 3 Machines dedicated to process queues… does this change the approach what you mentioned…

this would change the status and i believe it wont pickup by the bot… will check though

Hi @rajkumar.thyagarajan,

No this wont change.

Get queue items is related to orchestrator and queue being used(which would be same for dispatcher and performer model), no matter which machine your process is running from.

Regards
Sonali

It does not change the situation. I’m just saying its a waste of the licence for the dispatcher to have its own VM and to sit there blocking the machine repeatedly using the ‘get queue item’ activity until all the queue items it cares about are completed. Just have it go to sleep and wake up automatically when its needed.

Once you scale your automations then licence costs will be a large limiting factor, you cannot dedicate a machine to each dispatcher without incurring large costs.

@rajkumar.thyagarajan

Get Queue Item activity won’t change status of any Queue Item.

Thank you Jon, for the reference… need to understand more and how it works will look into this…

Thank you … yeap i see it … i got confused with Get Transaction Item ( Uipath.Core.Activities.GetQueueItem ) which changes the Status from New to Inprogress…
but as you mentioned Get Queue Items ( Uipath.Core.Activities.GetQueueItems ) is not changing the Status…

Thank you … yeap i see it … i got confused with Get Transaction Item ( Uipath.Core.Activities.GetQueueItem ) which changes the Status from New to Inprogress…
but as you mentioned “Get Queue Items” ( Uipath.Core.Activities.GetQueueItems ) is not changing the Status…

1 Like

@rajkumar.thyagarajan

Glad I could help :smiley:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.