Right mouse click to an application?

To send a right mouse button click to an application, choose the Global Mouse Click action in a Navigate stage.

This will have Inputs as below:

To send a right mouse, enter a value of “right” in the Mouse Button input – as per the help:-


Find and resolve process deadlocks?

Deadlocks occur when query X locks records A then B and query Y locks B then A. Process Y can’t get record A until Process X releases it, and Process X can’t release it until it gets record B, hence they are deadlocked. The only way out is for SQL Server to kill one of the queries.

SQL Server normally kills the cheapest query, the one it will have the least effort in rolling back. This means the deadlock victim as reported in the error is only one side of the story – to get the full story we need a deadlock graph from the database server, which shows which two transactions were involved and on which objects they were deadlocked. The trace flags described in the resolution below will give us this information.

These don’t have to be records in a table necessarily – they can be locking indexes for update or select in different orders.

Deadlocks are usually exacerbated by slow running queries, so first step is to get the worst query plans from the DBA and start to look for big table or index scans or CPU intensive loops and joins.

The steps below talk about methods to reduce the amount of data in the database – a query won’t show up as being inefficient until there is lots of data to trawl through, so generally they occur in large databases where this is lots of contention from a high number of resource PCs – before reducing the data it’s worth getting the info from the database so we can improve the product (the related article on database timeouts describes how this can be done in more detail).

There are a few things that can be tried, depending on version. For older versions of Blue Prism, you can run a script to add an index for the Work Queue Items tables to the database. In addition, the following SQL script can be used to delete any unused Work Queue tags:-

delete t
from BPATag t
left join BPAWorkQueueItemTag it on t.id = it.tagid
where it.tagid is null;

(See also the related document on database maintenance, with some useful scripts for reducing the size of various tables within the database).

Finally if deadlocks are still occurring, ask the Database Administrator to set trace flags 1204 and 1222 on the database and send us the error logs, which will tell us which indexes/tables are deadlocking.

The deadlock is caused by the statuses “locked”, “exception”, “deferred”, and “finished” being accessed in a range lookup index and also being attempted to be updated later in the transaction which causes the cross over.

In 4.2.42 and above, these status fields are removed from the index and the queries are optimised for better performance

How do I add a time interval to a DateTime?

To add a number of hours, minutes or seconds to a DateTime data value, set up a data item with type ‘Timespan‘. Using the function MakeTimeSpan() use the product of this function (its return value) to generate a time difference (positive or negative). Once you have the difference value, use a Calculation stage to add the difference value to your DateTime data item.

For example, to calculate the time two minutes prior to any supplied date/time value (using a variable called “myDateTime”), use this notation in a Calculation stage:

[myDateTime] – (MakeTimeSpan(0, 0, 2, 0))

Work with the MAPIEx VBO?

Installing MAPIEx

There are three main stages to ensure that the MAPIEx automation object is correctly referenced by Blue Prism.

1. Install the MAPIEx files onto the Blue Prism client (or on any machine that will use this functionality). The installer can be found on the Blue Prism portal under ‘Releases’ then by clicking the ‘addons‘ link. The installer file is called ‘BluePrismMapiEx1.1.15.msi

The installation will include the following files:-

  • BluePrismMAPIExAutomation.dll
  • BluePrismMAPIExAutomation.tlb
  • BPMAPIEx.chm
  • MAPI32.dll
  • MAPIEx.dll
  • BPA Object – Blue Prism MAPIEx.xml (in the ‘VBO’ sub-folder)

These files will be installed into the “C:\Program Files (x86)\Blue Prism Limited\Blue Prism Automate” directory as part of the .MSI installation process

2. On 64-bit machines, Blue Prism will be installed in ‘C:\Program Files’, but MAPIEx gets installed into ‘C:\Program Files (x86)’ because it is a 32-bit program. If developing on a 64-bit machine, either modify the installation folder to match your Blue Prism installation, or copy the installed MAPIEx files into the Blue Prism installation folder after the installation has been done.

RememberMAPIEx will not work with 64-bit Outlook.

3. The easiest way to use MAPIEx is to Import the BPA Object – Blue Prism MAPIEx.xml

If you wish to work programmatically with the object, edit the MAPIEx VBO from within Blue Prism’s Object Studio. Select the ‘Initialise‘ tab, and then double-click on the Business Objects Page Information stage (containing the properties for the page) to reveal the properties for this page. Select the ‘Code Options‘ tab. Browse to the ‘BluePrismMAPIExAutomation.dll’ located in the correct installation directory, ensuring that the full path and filename is referenced in the ‘External References‘ list.

e.g. ‘C:\Program Files\Blue Prism Limited\Blue Prism Automate\BluePrismMAPIExAutomation.dll’

MAPIEx as an Internal and External Business Object

MAPIEx can be worked with an an “internal” or “external” Business Object. Internal objects are imported into the Blue Prism database, and so are available to all users who have access to the database. External Business Objects are specific to the machine on which they are installed and are not visible by other users. It is generally recommended that the Internal Business Object is used in preference ot the External object.

To add MAPIEX as an External Business Object:-

  • Open the ‘External Business Objects’ tab in the Business Objects section of System Manager.
  • Create a new object, using the class name ‘BluePrism.WindowsAutomation.clsMAPIExAutomation’ in the ‘Add a new object’ field.
  • Click ‘OK’ to complete the process.
  • A new Business Object named “Blue Prism MAPIEx Automation (2005)” will be added.

What can you do with MAPIEx?

The main functionality involved with MAPIEx is to obtain information about e-mails and to manipulate them (i.e. delete, move, or send them). The in-product Help contains information about how each of the functions and associated parameters provided by MAPIEx can be specified.

MAPIEx can be used to check for e-mail in specific Exchange Server mailboxes, and can then reply, forward or move e-mails in response to this.


  • MAPIEx in v4.2 cannot deal properly with attachments that make use of non-English character sets.
  • It cannot currently use HTML or Rich Text e-mail formats, and deals only in plain text e-mails.
  • MAPIEx will only work with the Outlook mail client as a 32-bit application. 64-bit Outlook is not supported.

MS Excel VBO – GetWorksheetAsCollection(fast)

MS Excel VBO – GetWorksheetAsCollection(fast)

Another method is to use the Microsoft Excel VBO and to use its GetWorksheetAsCollection(fast) method to read the file in. This method takes a bit more preparation, and it requires having MS Excel installed on the machine that will execute the Process or Object. However, the advantage is that it reads all the data as text, and is therefore a more reliable for reading source data as pure text without trying to convert the data into a specific data type.Read More »