Hello!
It is a little bit difficult for me to understand what is queues, and how to work with them.
For now i understand that (correct me if I’m wrong, please):
Queue = datatable;
QueueItem = row of datatable, with data in object (specific content) and other things - status…,…,…,;
Transaction = row that is in work.
So i have a questions to work with it:
How i can SORT (not filter) items, that i am getting from queue? Always when i get list with items, the items that i added later is on first place. How i can get, for example, the oldest on the first place (sorted by date)? Or how i can get an oldest item with “Get transaction”? Both of this activities always getting items from new to old.
How i can MANUALLY set status “InProgress” for an item that i get from listOfItems(0)? I tried to do it with “Set progress” with progress parametr “InProgress”, but the studio said, that i can change progress only to transactions, that are in “InProgress” status.
What do you mean by change the order before? If i already got an item in queue, and i am adding a new one - it always getting first in Get Items activity. I dont see any options to change the order. Can you explain where i can do it?
Ok, but this activity takes the first “new” item in queue. And the problem is that i cant sort the line from oldest to newest, and it always get the newest item - this is not correct for my process.
You can change the order of the Queues by assigning priorities to each item. It will then fetch the items marked with HIGH priority first, then NORMAL, then LOW.
If you want certain items processed before others you will have to use a Switch/IF or similar to categorize the priority of your items before you add them to Queue , with the aforementioned categories (high, normal, low)
You can also filter the GetQueueItem with a reference (that you should also add when using the add to queue activity)
You can find more info about how to manipulate the items you want to add to queue here:
Hello, friend! And how do you see it? For example:
I got 100 users with 1 query per user. Every user will add an item to a queue. They doing it with an api button on my own web service. If i will use your advice to split this items with priority i will get the same result, but only in 3 different groups because in array of only LOW, or only NORMAL, or only HIGH priority i will again get the newest from this array of every priority, not an oldest that i need.
I use references to identify who sent the item.
Currently to get the oldest thing from an item list am using this way:
Got 2 queuse - one for new queries (named “new”) and other one for an InProgress and Completed (named “old”).
User add item with API button to queue named “new”;
Robot getting full list of queue items from queue “new”;
Robot using .Last method with this list to get oldest item;
Activity “Add Transaction item” with “Specific data” that i need to use later in process to queue “old”. This is setting to this item status InProgress automatically.
Activity “DeleteQueueItems” from queue named “new” with item that was retrieved as last.
Working with item as i need.
Set it as completed.
To continue work if something went wrong there is check at the beginning of an alghoritm (got any old branch). You can see it at screenshot.
@HomaDzz
You can change the order before you push the items to Queue.
Sort your Datatable —> By ascending or descending → Get sorted DT
Push the sorted DT to Queue → By “Add Queue Item” or “Bulk Add Queue Items”
Queue will push the items in same order as sorted.
But when you request “Get queue items”, The queue order will be LIFO or Random, As I
observed till now. (Queues are processed in FIFO order as per the documenation)
This sample xaml is for your reference Main.xaml (7.3 KB)