I’ve been perusing the forums trying to see if i can find an answer, but haven’t had much luck.
My automation involves the use of two separate queues. The first step will be checking if there’s data in both queues. (ReFramework is used for this process)
If yes, then i will have the bot get all the new transactions in that queue and write it to a csv. Once complete, the bot will need to upload this csv into a software.
I’m using GetQueueItems and a foreach loop to add all the transactions in that queue to the file (no issue there).
Is there a way I can mark all the transactions a success in one shot?
I’m having an issue with the transaction continuously looping even if there’s no more items left. I’ve tried setting it that Queue1 is nothing but that doesn’t seem to work too well.
I may even be making it more complex than it needs to be, so any help is appreciated!!
Ok.
Theres no way to “Set the Transaction Status” of multiple queue items in one shot. To change a Queue Item status to Success or Failure you have to first use the “Get Transaction Item” activity, this is the only activity that will change a Queue Item status to “In Progress”, effectivelly transforming it in a Transaction (that why you see those both terms being used).
From what you told, after completing all the transaction you have to write them all in an csv right? Why not write each one separately after ending each transaction? That way if you have 10 transaction but a problem made you stop in the 9, you can still upload those 9 and execute the last one in a second moment.
But yes, you can get all transaction in a single go. For that you can use a Do-While loop checking if the QueueItemTransaction (the one returned from Get Transaction Item) is null, if it is, then break the loop will stop.
If not, you add that Transaction to a list of transactions and then you process that list.
Instead of loading one queue item per row you could construct a json string and put that into one queueitem.
Then in your performer you can then deserialize that json into a datatable and write your csv file