Work queues

Work Queues - Click for a larger image

Work queues provide a mechanism for modelling the queueing, locking and reporting of work items within a Blue Prism environment.

Items

A work item contains a text key value to identify it amongst other items in the queue, a numeric priority, a text state value which can give some indication of the current state of the item, a set of text tags which can give more fine-grained information about the nature of the item and arbitrary data in the form of a collection.

When first created on a queue, an item has a workflow status of Pending. When selected to be worked by a process, it is Locked, following which the process can elect to set the workflow status of the item to Completed (to indicate that the item has been processed successfully), Exceptioned (to indicate that the item has failed in some way while attempting to process it) or Deferred (to defer processing of the item until a later date).

An item contains various metadata which be modified while it is being processed. The (text) status can be modified to indicate a simple status of the item. Tags can be added or removed to an item, allowing for categorisation of work items within a queue. Note that the key value cannot be changed once the item has been created.

Queues

A queue contains any number of work items which are passed out to consuming processes in order of priority, then in the order that they were added to the queue.

The queue which contains the work items is configured in System Manager – Workflow. The key field for the queue indicates which field in a new item's data collection should be co-opted to use as the key value for the item. This can be left blank to indicate that no items should have key values in this queue.

A queue can be configured to automatically requeue items which were marked with an exception a specified number of times. By default, items are not set to retry at all – an exception is considered to be the end of processing for that item.

A queue can be configured to automatically encrypt its contents using a predefined encryption scheme.

Using queues within processes

A work item can be created on the queue within a process by calling the Add to Queue action on the Internal – Work Queues business object.

Only one process / visual business object within a session can work a queue item at any given time – that item is locked for use by that process/VBO within its session by calling the Get Next action on the Internal – Work Queues business object. Only a process/VBO with such a lock can update the workflow status of the item.

You can filter the items to retrieve by key or by the presence or absence of a specific tag, by giving the appropriate arguments to the Get Next action.

Full documentation for the work queues business object actions can be found by clicking on the information icon : in the action properties dialog within Process Studio

Monitoring work queues

The queues and their items can be monitored and, to a certain extent, altered using the Queue Management tab of Control Room.