Handling Blue Prism bots with long executions

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Bots > Blue Prism bot integration >

Handling Blue Prism bots with long executions

Overview

Since Blue Prism integration is always executed synchronously, therefore, if your robot execution takes more than four minutes, you must use a different approach to integrate Blue Prism and Bizagi. This article explains how to handle this situation with the help of the Bizagi VBO that you can found in the Blue prism DX at https://digitalexchange.blueprism.com/dx/entry/6257/solution/bizagi-integration.

 

note_pin

A VBO is a special Blue Prism object that can be called by your robot process.

 

Strategy

Synchronous tasks lock the case in which they occur until they obtain an answer. Regularly, this isn't an issue because integrations tend to answer within seconds. However, this is not a common situation with RPA. Synchronous bot task will block the user, machine, and case for several minutes. During the execution, errors may occur, and they will block your case or create inconsistent data.

 

When using a Blue Prism bot the solution is to send the parameters to Blue Prism in the task, advance the case to an intermediate event and use the Bizagi VBO to advance this event. Since this VBO uses the oData layer we need to Generate your OAuth Client credentials.

 

To configure this strategy, you must follow the following steps:

1.Add an intermediate event after the robot execution task.

2.Generate your OAuth Client credentials.

3.Re-purpose your Blue Prism process to use the Bizagi VBO.

4.Create a connection to the process using the Fire and Forget triggering method.

5.Get your case ID using a rule.

6.Reconfigure your Bot connection.

 

Example

These steps are described, using this process as an example. In it, the task that executes the bot is called Provide client ID.

 

BluePrism10

 

The Blue Prism bot performs this process:

 

BluePrism12

It uses a different VBO to retrieve all the data on a client and then stores it in the shown variables, that are the outputs of the bot.

 

Add an intermediate event

The first step is to change your process diagram and add an event after the task that execute the bot. In our example the event Wait for BP.

 

BluePrism11

 

In the new event, create a form that contains all the attributes linked with the Bot outputs. This is important because the OData layer can only set the value of the attributes in the form.

 

Generate your OAuth Client credentials.

Go to your Work Portal and open the OAuth 2 Application section located at Admin -> Security -> OAuth 2 Application.

 

BluePrism13

 

Click the plus icon.

 

BluePrism14

 

Create a new Client credential application to use in Blue Prism.

 

BluePrism15

 

Pay particular attention to the user you link to the token since it should be authorized to see the selected process. Click Save to generate your application.

Save your newly generated Client ID and Client Secret in a safe location.

 

BluePrism16

 

Re-purpose your Blue Prism process to use the Bizagi VBO

The main action we want to use from the Bizagi VBO is the Advance case item.

 

BluePrism17

 

From the image, you can see that the activity needs the following parameters:

1.host_url: The URL address of your Work Portal

2.client_id: Client ID obtained in the previous step

3.client_secret: Client Secret obtained in the previous step

4.case_id: Case ID of the case that you want to advance

5.task_id: Workitem ID of the pending workitem that you want to advance

6.start_parameters: A collection of xpath and values that contain the information to elements to write in the Work-item form.

 

The missing parameters are case_id, task_id and start_parameters.

The case_id must be an input of the bot. Create it as an input for your process. To learn how to obtain this input from Bizagi, go to the Get your case ID using a rule section of this article.

 

BluePrism20

 

The start_parameters is built using the  Blue Prism Utility - Collection VBO. This collection must have two fields the xpath and the value.

 

BluePrism19

 

The task_id can be obtained using the Bizagi VBO activity Get Case Pending Tasks. This activity returns a collection of tasks you can then use the Blue Prism Utility - Collection VBO to extract your desired workitem ID.

 

BluePrism18

 

From the image, you can see that the activity needs the following parameters:

1.host_url: The URL address of your Work Portal

2.client_id: Client ID obtained in the previous step

3.client_secret: Client Secret obtained in the previous step

4.case_id: Case ID of the case that you want to advance

 

All of these parameters are known variables.

Finally, delete all outputs from the end activity. Your process should now look similar to this

 

BluePrism21

 

Create a connection to the process using the Fire and Forget triggering method

Go to your existing connection and edit your existing process.

In the Input and outputs summary you should now see no outputs and your case ID as one of your inputs.

 

BluePrism22

 

In this same window check the execute without waiting for an answer option.

 

BluePrism23

 

With this changes Bizagi will advance the case without waiting for any output.

 

Get your case ID using a rule

As shown in the previous steps, sending the case ID to the robot is paramount to the success of this strategy as such you should add an attribute to your process entity that holds your case ID.

 

BluePrism24

 

To set this attribute set an on enter rule in your bot task

 

BluePrism25

 

In the example, the rule contains this codde

 

<UpdateClient.CaseId> = Me.Case.Id

 

Reconfigure your Bot connection

Since the inputs and outputs of the robot had change we have to re configure the mapping of the bot.

 

On the input window map your case ID attribute to the bot attribute along with the other inputs

 

BluePrism26

 

Make sure that no output parameter is mapped

 

BluePrism27

 

With this your bot is ready to run with Bizagi regardless of the fact that its execution takes several minutes.