Basic steps for using a queue in a Blue Prism queue, including how to add and get data to a queue, as well as handling exceptions
You first need to create a queue. Refer to the article “Setting up a Queue in Blue Prism” to see how to do this.
The process would generally be set up as per the diagram below.
It is common practice to store the name of the queue to be used in a Data Item.
This action will take the items from a collection and add them to the queue specified. All items added are automatically assigned a unique ItemID by Blue Prism.
The compulsory inputs to the action are –
If you look at the queue in the Control Room after running this action you will see all the items from the collection. The only part of the actual data that you will see is the Item Key. This is the key field you provided when setting up the queue. The rest of the data from the collection does not show but has been stored in the Blue Prism database.
This action is used to take one item from the queue. Blue Prism automatically takes the oldest item with the highest priority. It will also lock that item so that it cannot be processed by any other robot.
The only input you must provide is the name of the queue.
Key Filter and Tag Filter – use this to be more selective as to which item can be taken from the queue. The key field is the field you provided when setting up the queue.
More information on this will follow in another article.
This action has important outputs for which you need to provide a Data Item or Collection to store the output.
The outputs you must store are –
The other 2 outputs, Status and Attempts, only need to be stored if the path an item must follow depends on these values.
Blue Prism may not get an item from the queue in the following situation –
To know whether an item has been retrieved from the queue you need to use a decision with the expression as shown below.
The steps to process the item are normally built on one or more sub-pages. When you need to refer to the data of that item you will use the collection you put as an output in the Get Next Item action e.g. Queue Item.
For example, if you need to check whether a piece of data is there you would set up a decision like the one below.
Since the Queue Item is an undefined collection you will not see the fields when you look at the list on the right. You can simply type the field name in the expression. Make sure it matches the name as per the original collection.
If the robot gets through all the steps to process an item successfully then you need to mark that item as complete. If you do not put in this step Blue Prism will automatically mark the items you processed as exceptions when the process finishes.
The only input you must provide is the Data Item that stored the Item ID.
When you look at the queue in the Control Room you will see each item that is complete shows a tick on the left. You can also see the time it took to work each item.
It may happen that processing an item fails for some reason. To pick up these issues you need to have a Recover and Resume on the Main page. Between the 2 you need to store the Exception Details. Make sure all the steps, which deal with processing the item, are in a block with the Recover.
After the Resume you will have a Mark as Exception.
You must provide the following inputs –
It is possible to retry an item that failed. More details on how that works in a future article.