<< Click to Display Table of Contents >> 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.
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.
The Blue Prism bot performs this process:
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.
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.
Click the plus icon.
Create a new Client credential application to use in Blue Prism.
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.
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.
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.
The start_parameters is built using the Blue Prism Utility - Collection VBO. This collection must have two fields the xpath and the value.
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.
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
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.
In this same window check the execute without waiting for an answer option.
With this changes Bizagi will advance the case without waiting for any output.
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.
To set this attribute set an on enter rule in your bot task
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
Make sure that no output parameter is mapped
With this your bot is ready to run with Bizagi regardless of the fact that its execution takes several minutes.
Last Updated 1/6/2022 4:36:24 PM