Introduction to Blue Prism Queues
Most robots in Blue Prism will need to work through items such as rows of data in an Excel file, emails in an Inbox or files in a folder. At the end of running the robot it is important to know which of these items where successfully processed and which failed. This is when you need to use a queue.
The picture below shows an example of a queue.
Each row represents one item or case on the queue. The icon in the first column indicates whether that item was completed (✓), failed (🚩) or is still needs to be processed (…). Failed items on a queue are known as exceptions.
Each robot will typically have its own queue that it uses though it is possible for multiple robots to use the same queue.
1. Basic steps for using a queue in a process
- Add a collection of items to the queue
- Fetch one item from the queue.
- Check if there is an item. If none, then stop the process.
- If there is an item, process that item.
- If all steps are completed successfully, mark that item as complete.
- If any problem happens while processing the item, mark that item as an exception.
- Keep looping through these steps until there are no more items to process.
2. Add to queue
- You will need to provide the name of the queue and the collection of data that needs to be added to that queue.
- Blue Prism will automatically add a unique item ID to each item added to that queue.
- By default, all items will get a priority of 0 which is the highest priority. It is possible to choose a different priority for a set of data.
- Blue Prism will not automatically check if you are duplicating any items already on the queue.
3. Get an item from the queue
- By default, Blue Prism will fetch the oldest item with the highest priority.
- You will need to store the data and item ID for that item.
- Blue Prism will lock the item it fetched off the queue. This is to prevent another robot from processing the same item.
4.Check if there is an item
- If there are no more items on the queue the “Get item” step will not fail but rather just return an empty item ID.
5. Mark an item as complete or as an exception
- If you do not instruct Blue Prism to mark an item as complete it will assume it is an exception.
- When marking an item as an exception you can provide an exception reason.
6. Additional information
- It is possible to separate the adding of data to the queue and the of processing items into two robots.
For example, one robot will fetch all the unread emails from a specific Inbox, extract the relevant data from the emails and then add that data to the queue.
A second robot will fetch an item from the same queue and processes it accordingly.
- You can generate an Excel report which gives details of the items processed or a report which lists all the exceptions that now may need to be processed manually.
- You will be able to see various information about the items on the queue including the average time per item.