Thursday, February 27, 2020

Using LookUps in OIC

Here is an demo for using a LookUp in OIC



Browse OIC IntegrationDesignerLookUpsCreate

Step1: You can select respective adapters. I have chosen as per the adapters that I am using for this integration.








Step2: Once Lookup is created. Go the Integration Mapper, then drag the lookupvalue function to the input literal (blank space)









Follow the instructions. Provide default text and map the source. Once done - The integration is good to be activated. 

Note – A csv file can also be used for importing values.

Tuesday, February 25, 2020

Types of OIC integrations


OIC supports the below mentioned types of Integrations. I have copied details from OIC in the table below.

App Driven Orchestration
Multi-step Integration flow invoking applications, integrations and processes triggered by an Application or API.
Scheduled Orchestration
Multi-step Integration flow invoking applications, integrations and processes triggered by a Schedule. Commonly used for Batch/Bulk Integrations or File processing.
File Transfer
Seamlessly and securely move files across the network.
Basic Routing
Basic App to App Routing with Data Mapping.
Publish To OIC
Publish messages from Apps to OIC Pub/Sub Channel.
Subscribe To OIC
Subscribe to messages from OIC Pub/Sub Channel.

More details can be found here This documentation is very easy to follow for understanding the Integration types. 



Sunday, February 23, 2020

Create REST Integration using Oracle Integration Cloud

Using OIC this post explains easiest way to create a REST API using OIC integration



Step 1: Create an outbound Rest Connection using adapter as REST and type as INVOKE. Keep Connection Type-REST API Base URL
Provide- REST URL and Security Policy as needed to create Outbound


Step 2: Create Generic Inbound Rest Connection using adapter as REST and type as TRIGGER. The creds needed to invoke will be basic and will be same as the creds needed to login to OIC.

Step 3: Create a Basic Routing integration (Basic App to App with Data Routing). Drag the REST connection created in Step 2 



















Provide a Name and DataType in Specify Query Parameters.

Configure the Response Payload
















Click enter sample JSON which corresponds to the Invoke Connection created in Step 1
{
  "id": "Value"
}

Step 4: Drag the REST connection created in Step 1 into Drag and Drop an Invoke and perform the same steps as done in Step 3

Step 5: Do the mapping for Execute and Execute Response. Do validations and the mappings should now look green. 

Step 6: Add tracking. 








Step 7: Activate the integration
Step 8: Get the URL details and set up the SOAP UI with the URL. Give the UserId and Password used to login the OIC. Provide the Domain from the URL.
Step 9: Add the string, since it’s a GET and provide value. Run the request and the response received will be response. 

Tuesday, February 18, 2020

Decrypt, Unzip and Transfer files using Oracle MFT


Oracle MFT 12.2.1.3.0 Use Case

Those familiar to MFT will find it easier to understand this post. Oracle Managed File Transfer (MFT) is a high performance, standards-based, end-to-end managed file gateway.
Use case – Inbound Transfer of an encrypted zip containing multiple files using Oracle MFT 12.2.1.3

Oracle MFT provides the easiest way to do a file transfer which needs encryption and compression of multiple files. The following diagram will explain how to achieve this - 




Flow 1 – Decrypt and Unzip the source file into a temporary location -
1.       Have PGP key installed in MFT server needed to be decrypted
2.       Create Source, In Advanced Properties Specify Regular Expression as (?i)\b(INCOMING.*zip.pgp) if the file format is INCOMING.zip.pgp
3.       Create Target with Temp folder location. Temp folder location is the place where the file will get unzipped.
4.       Create MFT transfer and keep the following –










Flow 2 – Move the unzipped files to the vendor location
1.       The incoming zip format should always be the same.
2.       Create Source with the same location as Flow 1, Step 3
3.       Create target with Vendor location.
4.       Create transfer with above created Source and Target


Tuesday, February 11, 2020

Create Service Now ticket using OSB 12C


Service Now is a SAS service to support IT Service Management for Helpdesk and workflows. This post will help you create a Service Now incident using OSB using Email. I am using JDEV Studio Edition Version 12.2.1.1.0 for the post.

1.       Step1: Create a Business Service in OSB. Set Transport as ‘email’
a.       Service Type: Any XML
b.       Provide your email to the Endpoint URI (this will be overwritten later)
c.       Once saved, Provide SMTP server to the Email Transport Configuration.

2.       Create a WSDL from the below schema-
<xsd:sequence>
            <element name="to" type="string" minOccurs="1"/>
            <element name="subject" type="string" minOccurs="1"/>
            <element name="from" type="string" minOccurs="1"/>
            <element name="body" type="string" minOccurs="1"/>
            <element name="type" type="string" minOccurs="1"/>
            <element name="cc" type="string" minOccurs="0" nillable="true"/>
            <element name="name" type="string" minOccurs="0" nillable="true"/>
            <element name="content" type="base64Binary" minOccurs="0" nillable="true"/>
   </xsd:sequence>

3.       Create a Proxy using the created WSDL. In the route node call the Business Service created in Step 1. Update the transport headers.


4.       Insert into the attachment, if an attachment is needed to be passed -
<con:attachment xmlns:con="http://www.bea.com/wli/sb/context">
<con:Content-Type>{$body/sen:sendEmailRequest//*[local-name()='type']/text()}</con:Content-Type>
<con:Content-Transfer-Encoding>base64</con:Content-Transfer-Encoding>
<con:body>{$decodedContent}</con:body>
</con:attachment>

5.       Finally changes with respect to service now. Verify with Service Now team the email format and the parameters that needs to be sent to have a Service Now ticket created. You can use the below concat to format the request going to Business Service and this will create ticket using the Email API of Service Now.

//constructing the email. needs to be in this order
concat('^',  $ticket.group   ,
fn:codepoints-to-string(10)  ,
'^',  $ticket.userId     ,
fn:codepoints-to-string(10),
'^',  $ticket.impact    ,
 fn:codepoints-to-string(10),
 '^',  $ticket.affectedci    ,
 fn:codepoints-to-string(10),
 '^',  $ticket.area     ,
 fn:codepoints-to-string(10),
 '^',  $ticket.subarea    ,
 fn:codepoints-to-string(10),
 '^',  $ticket.urgency     ,
 fn:codepoints-to-string(10),
 '^',  $ticket.operatorId     ,
 fn:codepoints-to-string(10),
 '^',  'incident'    ,
 fn:codepoints-to-string(10),
 '^' , $ticket.nonci,
 '^', + $ticket.title  ,
  fn:codepoints-to-string(10), '^',   $ticket.description ,
 fn:codepoints-to-string(10)  )

Friday, February 7, 2020

OIC Antipatterns or Best Practices

Oracle anti-pattern recommendations in one post-



1     Integration which talked too much 
Avoid fine grain invokes inside loop. This impacts downstream applications and can alter cloud pricing. 
Instead use Application or Adapter capabilities to send batch requests for processing either as request or opaque attachments. 
2     Scheduled Job which never gave up
Avoid scheduled job to process all the files in one schedule. Long running job starves other jobs which results in getting killed by the framework.
Instead limit the files to be run. Secondly call the same integration after limit is reached remembering the last processed file.
3     Look, I hacked my Integration!
Avoid externally updating the IAR file while updating complex constructs in XSLT. Integration metadata might get corrupted leading to activation failures.
Instead just alter the XSLT using import XSLT option.
4     Synchronous flow which tried to do too much
Request triggers a complex processing involving enrichment and updates across multiple system. Susceptible to timeouts, marginal slow down, half done processes.
Use asynchronous services, coarse grain callouts, avoid multiple chatty calls.
5     Too Many keys for the same door!
Multiple developers duplicate same connections. This leads difficulty in managing connections when there is an endpoint update needed resulting in bad operational maintenance. There should be a reviewer validating the connections being unique.
6     Read more than what I could chew
Read a file with large number of records and process individual records. Reading large file in memory consumes resources for other running integrations.
Instead download file and read in segments.
7     I Skipped the Spring Cleaning ...
Integrations created during development continue remain activated without being decommissioned. Bad to manage and maintain.
Always deactivate or delete the unused integrations. Its always always present in the GIT or any other repository.

Tuesday, February 4, 2020

OIC and Javascript


OIC and Javascript

Ø  Javascript can be used to perform additional level of validations or business validations. This post will provide some basic understanding on how to use a Javascript.
1.       First create a Javascript File, a filename with ‘.js’ extension. There can be more than one functions but during registration there should be atleast one function.
2.       Configure the metadata in the library. The function can then be used in the integration.
Ø  Datatypes supported by OIC for calling Javascript function-
1.       String, Number, Boolean and Return
Ø  What to do if the Javascript input is an Array.  
1.       Create a function using input as a string. Convert the string into array using the below –
function myArrayProcessor(myArray) {
                var status = 'FAILED';
                var data = myArray.replace(/'/g, '"');
                myArray = JSON.parse(data);
     for (i=0; i<myArray.length; i++) {}
  return status;}
Ø  From the integration pass the array as a string to the Javascript function. The input string will be parsed as an array in the Javascript function itself.
1.       If there are more than 1 Javascript files. Then create a Jar file and register in OIC.
Ø  To debug Javascript code use an instance of CXConsole() like in the sample code below.
2.       var console = new CXConsole();
console.log("# Variable: ", variable);
Ø  OIC has a javascript function thread execution duration of 1500ms. OIC automatically cancels the thread which runs beyond 1500ms.


If you have any questions : please mail to : kavi.dhiresh@hotmail.com

FBDI Introduction

FBDI  stands for File Based Data Import. It is a pattern provided by Oracle to have the data loaded into Oracle ERP Cloud. Its usually u...