I have a process where there are 100s of outlook mailbox folders which has to be tracked and its name has to added to secondary queue and based on certain criterias will set the transaction status of this queue as successful or failed. For the ones that are marked successful(queue items from secondary queue) the mails from that mailbox are added to the primary queue of RE-Framework and for the ones that are marked failed we do nothing.
I have built a logic, but the secondary queue is not getting incremented and goes in an infinite loop with the first transaction item itself. How do I increment the transaction number to tell the bot to go for another item in this secondary queue?
For Each Loop - Add these account names to the AccountName Queue. Here I have enforced unique reference and reference value is the account name itself. If duplicate reference error occurs while uploading data to AccountName queue, log error in catch block and continue with the next item.
Get Transaction Data:
Get Transaction Data for EmailName Queue(Queue data used for processing in process state)
If transaction item is not nothing for above, then skip and goes to end process else continues
Use “get queue item” activity in AccountName Queue, filter with 'New" status - Store output in qi_AccName
While qi_AccName.count>0,
4.1 Retrieve mails that match a particular pattern in subject line and upload as transaction to EmailName Queue
4.2 If all mails retrieved successfully mark the queue item for AccountName queue successful else mark failed due to BRE/SE
4.3 Use “get queue item” activity in AccountName Queue, filter with 'New" status - Store output in qi_AccName
Process
Process items from EmailAccount Queue - Forward it to a particular mail address and delete the outlook mailbox
End Process
Now here the 1st queue - AccountName keeps on fetching the 1st queueitem data even after the particular queue item is marked as successful or failed and goes in an infinite loop
I used a “do while” loop in get transaction data for the first queue with the condition transactionitem isnot nothing and the body contained get transaction item and the logic based on which the bot would update the status of the queue items.