How To: Integrate K2 and Blue Prism
KB002323
DOWNLOADS
Discover the options available for integration between K2 and Blue Prism, for both inbound and outbound communication that allows you to make calls from K2 (via SmartObjects) to start processes in Blue Prism and how make calls from Blue Prism interact with K2 forms and workflows.
Prerequisites and Requirements
K2 requirements include:
- K2 blackpearl 4.6.11 or greater, K2 Five or K2 Cloud
- A basic understanding of K2 service types
- Administrative rights to configure new service instances and to enable the REST API
Blue Prism requirements include:
- Blue Prism version 5.0
- Administrative rights in Blue Prism to enable web services
- A deep understanding of authoring Virtual Business Objects (VBOs)
In addition to the above requirements, you must have a basic understanding of SOAP and REST-based web services.
Architectural Overview of Integration
Use the following diagram for understanding how K2 and Blue Prism communicate with each other.
Scenarios
Use the following scenarios for the type of integration you need between K2 and Blue Prism.
Scenario 1: Use the Endpoint Web Service to Call Blue Prism Processes and Objects
Enable the SOAP-based Blue Prism web services, and then create a K2 service instance and SmartObjects that interact with the Blue Prism services. Use these SmartObjects in a SmartForm or workflow to make calls from K2 to Blue Prism.
Scenario 2: Use the Workflow REST API to make calls from Blue Prism to K2
Use Blue Prism VBOs to call the K2 Workflow REST API to start or action K2 workflows from Blue Prism.
Scenario 3: Use K2 SmartForms and SmartObjects as a Replacement or Extension of Blue Prism
Use the Blue Prism Application Modeler to start and interact with K2 workflows and SmartObjects through a form.
Scenario 1: Use the Endpoint Web Service to call Blue Prism Processes and Objects
You can interact with Blue Prism through SOAP-based web services by first enabling them in Blue Prism and then creating a service instance and SmartObjects in K2.
Step 1: Expose Blue Prism Artifacts as Web Service Endpoints
- Log in to Blue Prism with administrative privileges which are necessary to configure system options.
- Locate the System settings option on the left. There are two nodes you can use to configure the web service: Processes and Objects. Use processes to manage Blue Prism processes and objects to manage VBOs. Both nodes have an option called Exposure that allows you to configure web services. Keep in mind that you must enable these per artifact and that they are not enabled by default. The example used here uses a process but the steps are the same for VBOs.
- Expand the Processes node and select Exposure. This opens the Process - Exposure pane in which you click Expose a Process to open the dialog.
- Select the process to configure for web services and click Next.
- Specify a name for this endpoint and then click Finish.
- Verify that the process appears in the Web Service Exposed Processes list.
Step 2: Test Blue Prism Web Service Endpoints
Test the service you created in Step 1 by following these steps.
- Open a web browser.
- Browse to the URL http://<BluePrismMachineName>:8181/ws/
- Your browser should look similar to the following page:
- Click one of the WSDL links that you see on the page to see the XML representation of Blue Prism artifacts exposed by the endpoint.
Step 3: Configure the K2 Endpoints WebService Instance
Use the Endpoints WebService service type to create a service instance that connects to Blue Prism using SmartObjects.
- Open a browser and go to K2 Management
- Click Integration > Service Instances
- Click Add and select Endpoints WebService as the Service Type
- Specify values for Display Name, Description and select an Authentication Mode of Static
- Specify a User Name and Password of an identity that can log in to Blue Prism and use the endpoint
- In the Settings section of the service instance configuration, find the WebService URL property and enter the URL of the Blue Prism endpoint, including the ?wsdl. The example used here is http://dlx:8181/ws/K2Test?wsdl
- Click OK to complete the configuration and you see the following confirmation.
- The new instance is located on the Service Instances page. Find and select the instance, and then click Generate SmartObjects to generate the SmartObject necessary to call Blue Prism (or use K2 design tools to create your own SmartObjects). You can now use these SmartObjects with SmartForms, and in worfklows by dragging a SmartObject Event onto the workflow design canvas.
Scenario 2: Use the Workflow REST API to make calls from Blue Prism to K2
Blue Prism communicates with REST APIs using Virtual Business Objects (VBOs). Native support for REST APIs is not included in Blue Prism at the time of this article's publication. Talk with a Blue Prism subject matter expert with experience in authoring VBOs to help you set up this scenario.
There are many out-of-the-box examples with Blue Prism, including one that uses REST.
Step 1. Enable the K2 Workflow REST API
You must enable the K2 REST API before configuring Blue Prism.
- Open a browser and go to K2 Management
- Click Integration > APIs > Workflow Rest
- Click the Workflow API switch to enable the API
- Use the Swagger documentation (accessed through the Swagger descriptor URL in the screen shown above) to find the methods you want to use, along with the URLs and parameters.
For more information about working with the Workflow REST API, see the K2 Cloud and K2 Five Developer Reference content.
Step 2: Create a Blue Prism VBO that calls the K2 REST API
In Blue Prism, create a VBO that calls the K2 REST API. (The example shown below is available to download, see the links on the right-hand side of this page).
Scenario 3: Use K2 SmartForms and SmartObjects as a replacement or extension of Blue Prism.
Another option for working with K2 from Blue Prism is using K2 forms to control a Blue Prism robot. Blue Prism enables interacting with forms and programs as part of their Application Modeler functionality.
Using Application Modeler, you could configure Blue Prism to start and interact with K2 workflows and SmartObjects through a form. In this way, the VBOs that you create could be leveraged by more people developing solutions with K2.
Conclusion
The integration path that you choose to integrate K2 and Blue Prism depends on the needs of your solution. While the VBO path provides the potential for a more generic, reusable integration that can be created with a certain amount of resilience built in, using a K2 form can be a viable option for scenarios where project scope or resource availability require a different approach.