Monday, August 2, 2021

#874 OIC & Blue Prism Part 3 - Invoking an OIC Integration from Blue Prism


This post details how to invoke OIC REST based integrations from Blue Prism. 
The first example is calling an OIC integration, exposed as REST. The verb is GET and a parameter needs to be passed. The second example, uses POST and has JSON request / response payloads. The final example uses POST and a JSON array.

Example 1 - GET with Parameter

The integration, AA-HelloWorld-GET, is very simple - 



I test it in OIC - 


Ok, let's now invoke this from Blue Prism -

Some setup first - Create Security Credentials in Blue Prism - this essentially holds the OIC username/password I want to use.


I have called my entry here - Oracle Integration



Very important - thanks to Google for this - you need to set the Access Rights -
I just selected all, for simplicity sake -


Ok, that's the credentials taken care of - now to define the OIC api we need to call -


 
I have called mine OIC and the configuration is as follows - 

Specify the base OIC url here -


I specify the use of the Credential here - 



Note, I have 2 actions - let's look at GetHelloWorld - and its configuration - 





Now let's invoke this from a Blue Prism Process - this is probably the simplest Blue Prism process ever!


I used an "Action" for InvokeOIC - it's configured as follows - 


Note the input - here I hard code it to "BluePrism".

Essentially, that's it - the Output is configured as follows -  


I run the Process - 


I check OIC Monitoring-Tracking -


I can also see this in Blue Prism Control - 


I can easily process the OIC response - all I do is add an output value to the End.



I re-run the Process in the Control Panel, by dragging the process to a robot. 
I see the response -


Example 2 - POST with JSON Request/Response

Here is my OIC integration - 

























Note the Request/ Response JSON payloads above; these will be used when creating the Web API definition in Blue Prism. 


I create a new API definition in Blue Prism (System - Web API Services) - 



I add the following Parameters


These are then used in the Request definition - 


Note, the orderStatus is hardcoded - "pending".

I add the following Request Header


Now to the Response


Here is my Blue Prism automation Process -


Again, very simple, it only invokes the OIC integration. Let's look at the configuration - 



Note how the 2 response fields I specified appear in the Outputs section.


I test the Process -


I check for the instance in OIC - 



I see the response in Blue Prism - 


Excellent, as we say in Germany, wir sind die Roboter!


Example 3 - POST with JSON Array

Now what happens if the JSON request contains an array?
Here we can leverage the Blue Prism JSON Utility - 


 
I import the file - 



Now to the actual Process, I will read the Excel file used in the previous post


The contents of this file need to be passed to the following OIC integration - 


Note the array of employees - akin to those in the Excel sheet.
I use the Excel workbook processing logic from the previous post - 


Note the 2 new actions - Utility - JSON:Collection: Collection to JSON and OIC ProcessEmps.
But firstly, the Web API definition - 






The Utility:JSON action is configured as follows - 
















OIC-Process Emps action is configured as follows -




I test the Process - 



I see the instance in OIC - 


















  



No comments: