Tuesday, July 5, 2022

#915 OIC Jira Adapter - Add Attachments etc.

Use case here is simple, something goes wrong, I need to create an Issue in Jira. I then need to add an attachment and a comment to the aforementioned. 

So simple stuff here. I am using my trial Jira account -


















I will be using the following Authorization method, when creating the Jira connection in OIC - 



















This requires client id and secret - these I get by creating an app in atlassian - https://developer.atlassian.com/ 


































Click on Authorization -



































Enter your OIC callback url - format is https://yourOICInstance:443/icsapis/agent/oauth/callback
















Click on Settings to see client id and secret - 

























You will use these when creating the connection in OIC.
Final thing you need to do here is select the Permissions -  what you want OIC to be able to do.


















I check all the Jira boxes -














































Create the OIC JIRA Connection 


Now to OIC - Create the Jira Connection - Please note - the Scope entries are NOT optional here.

























Now to using the connection in a simple integration - here I create an issue add a comment and attach a file.

Create the Integration


The integration is app driven with a REST Trigger, configuration as follows -





























Next step is to create the Issue -

Create Jira Issue/ticket




















Mapping - 


 























Next step is to add the Attachment -

Add Attachment to Jira Issue/ticket

I retrieve the file from an FTP server and then invoke the Jira adapter.
Adapter configuration is as follows - 
















Mapping is as follows - First I set the id -





then the file reference -






Note: you also need to set the following target field - value is "file"






























Add Comment to Jira Issue/ticket

Same modus operandi - I won't go into the gory details - 












Test it!




Check out Jira - 











Friday, July 1, 2022

#914 - OIC - End to End Business Process Automation

Introduction

I introduced this topic in a previous post, but now to a concrete application of what was discussed. Here we have a scenario of documents being uploaded in a content management system. These documents could be purchase orders, invoices etc. and they need to be processed automatically, as much as possible. This post details how such could be implemented with OIC. I have added an extra step for human approvals, as this is often the case; there always are occasions where some documents need to be validated before further processing can take place. The graphic below illustrates the demo flow I have created. Documents are uploaded to a CMS. An OIC integration can be triggered each time a document is created, or else we could have an OIC scheduled job polling the CMS on a regular basis for new files.











The OIC integration passes the document to OCI AI-Vision. The latter parses the document, returning document type, key values etc. In my case, all invoices need to be approved by finance before being created in Netsuite. In my example I only implement the Invoice "route", but I'm sure we can all extrapolate from that. 

CMS

As in the previous post, I am using OCI Object Storage as my "CMS". Naturally, in the real world, you would be using a proper CMS such as Oracle Content Management. Object Storage can emit an event - new object created - and this event can raise an OCI Notification, which results in an OIC integration being triggered. As mentioned above, OIC could also poll the CMS for new documents on a regular basis. The mechanics of setting up Object Storage -> Events Service -> Notification Service-> OIC are discussed in the previous post on this topic. 

OCI AI Vision

OCI AI Vision Service has also been discussed in the previous post on this topic. Net, net, the service has a rich REST api you can leverage to analyze documents. Here is an example with my sample invoice.  

First the invoice - 













then the analysis -














The Response json is worth reviewing as this is what needs to be parsed in the OIC Integration.


 
















OIC Integration

The main integration can be implemented as an app driven or scheduled orchestration - in my case, app driven. I create a REST connection to OCI Object Storage and use this to retrieve the document(s) - 








Next step, as you can see, is to invoke OCI AI Vision via an OIC REST connection to analyze the document. 

I implement a SWITCH action to parse the result from OCI AI Vision -










Above, is the Invoice path. The For Each loops are used to extract the result - key fields etc.   
Finally, I invoke the OIC Process - Approve Invoices.














OIC Process














I can easily add documents to the Process - in other words, OIC integration can invoke the process and add the original invoice to the Process documents folder -  


 









So let's test!

Test


I upload an invoice to my "CMS" -











The Integration is triggered and returns - 












I check my OIC Process Tasklist - 

























































The form shown above is the generated default, naturally, this can be prettified. Again,  the original invoice image can be attached to this process instance as a document.

 

Summary

I realise this is a simple example, but it does show the power of OIC & OCI to implement such use cases. 

Monday, May 23, 2022

#912 - OIC and OCI Logging Service

It is very easy to push the OIC Activity Stream logs to OCI Logging - just enable it -

Login to your OCI console and navigate to Logging - 












Then enable the OIC log - 






























Now I will test a couple of integrations to generate some log traffic - 

Here is an integration that generates an error - I test this a couple of times. 






















I also have another simple integration - 

























Let's check out the log data in OCI Logging Service - 













In more detail - 

Note the Retention Period - 


















Note the Log Search link - let's check this out








I add a where condition to check for Error. My integration that throws the error will set the errorCode field to ErrorNN.








All log rows containing the string "Error" are returned.






















I can hover over the rows to see the details - 








I can save the Search - 

























I can also look for specific payload values - e.g. the product "iBike" I used in my integration test.




































One can also add custom Filters -


















Here's a simple example - checking for a specific instance id - 



















Here's another example - checking for logs from a specific integration - note the format of the integration - Identifier | Version.