Wednesday, March 24, 2021

OIC - Synchronous Integrations Occasionally Fail with a 504 Gateway Time-out Error

 Synchronous Integrations Occasionally Fail with a 504 Gateway Time-out Error


Synchronous integrations can fail with the following error.

    Bad response: 504 Gateway Time-out from url

    https://Instance_URL/Integration_Name/Version_Number/


This error occurs because synchronous integrations (integrations that return a response payload) are limited to 300 seconds and return a timeout error if they exceed that limit.

Optimize your integration and/or the endpoint you invoke to complete instance execution in under 300 seconds.


server limits:

server-Limits


Tuesday, March 23, 2021

OIC - JS - Return boolean status based on ERP result status

Requirement:

From ERP we are getting Import status as 'SUCCEEDED','WARNING','ERROR','CANCELED' and we need to convert it to boolean status like true or false.

JS code:

function returnStatus(result) {

 var inProgress;

  if (['SUCCEEDED','WARNING','ERROR','CANCELED'].indexOf(result)==-1)

  {

  inProgress = "true";

  }

  else

  {

  inProgress="false"

  }

  return inProgress;

}

Sunday, March 14, 2021

OIC - Javascript - to remove carriage return

For instance the method you made could be made more general to parse input from several different types of files. Due to differences in Operating system it is quite common to have files with \n or \r where a new line is required. To be able to handle both your code could be rewritten using some features of regular expressions. 

function removeCarriageReturn(variable){

var newString = "";

var newString =variable.replace(/[\n\r]/g, '');

return newString;

}



Wednesday, March 10, 2021

OIC - Use of Javascript in Integration | Add two numbers to keep fixed decimal positions

Usecase: Convert 2 numbers and rounding the numbers to keep only three decimals.

Step 1 : Create .js file and import in Libraries

add2NumbersTest.js

    function addTest(num1,num2){

    var newNum;

    var newNum2;

    newNum = parseFloat(num1) + parseFloat(num2);

    newNum2= newNum.toFixed(3)

    return newNum2;

    }

Import Navigation:

Integrations--Libraries--create--choose File --provide library name--create--select function--save







Step 2 : Create an Integration and use the javascript action and test it.

I have created a simple REST trigger connection and created an app driven Orchestration integration and in the REST trigger, I have added relative URL as /addTwoNums, Verb as POST, Configure following two options:

Configure a request payload for this endpoint

Configure this endpoint to receive the response

Input:

{

"num1":123.34567,

"num2":234.34455

}

choose Json as response payload type and  provide inline Json sample

{

"result": "234.56"

}

Add Javascript action and choose the created JS function. and map the two inputs with num1 and num2.

Last map the JS response with the output of the rest service.




















Add Tracking and test



Tuesday, March 9, 2021

Shell script to move files older than 10 days

A small script to move file from one directory to another.

step1: Create a file with name file_move.sh

    for i in $(find  absolute_path_from_move -type f -name "*"  -mtime +10 2> /dev/null);

    do

    mv $i archive_path;

    done

step2: execute with Command 

    sh -x file_move.sh

Wednesday, November 4, 2020

OIC - Exception Handling

 OIC provides two out of the box features to handle exceptions.

  • Scope Handler:
Scope is one of the out of the box activity allow you to bundle a set of activities which have their own variables, Faults and event handlers. In other words, scope allow you to handle error raised in IC. It is like as try and catch block in other programming languages as java, dotnet etc. every scope activity has their own fault handlers which is treated as catch block.

Click here oic-scope-level-error-handling for POC.

  • Global Fault Handler:

The Global fault handler is super catch block which handle all the errors which are not supported by scope handlers. This functionality enables you to direct business faults to the caller or apply business logic before sending faults to the error handling framework. you can add fault handling to any integration type.

Click here oic-global-fault-handling-in-app-driven for POC.



Tuesday, November 3, 2020

OIC - Connectivity Agent part 2

 This includes:

  • Pre-requisites for Connectivity Agent
  • Download Connectivity Agent
  • Install Connectivity Agent
  • Start/Stop Connectivity Agent.
  • Log files of Connectivity Agent
Pre-requisites for Connectivity Agent:


Download Connectivity Agent:
Step 1:
Go to the OIC Agents ⇾ Create Agent group ⇾ Provide Agent Group Name ⇾ create

Step2:
Next click the Download button ⇾ Connectivity agent and it will download oic_connectivity-agent.zip
 
Connectivity Agent Installation:
Here showing the installation in Linux system.

Step1: Java jdk 8 version should be installed.
export JAVA_HOME=/home/opc/java/jdk1.8.0_251
export path=$JAVA_HOME/bin:$PATH
java -version
java version "1.8.0_251"
Java (TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot (TM) 64-bit Server VM (build 25.251-b08, mixed mode)

Step2: unzip zip file
unzip oic_connectivity_agent.zip
ls -ltr
InstallerProfile.cfg
cpi_upgradeutility.jar
coonectivityagent.jar
agenthome

Step3: Provide OIC url and agent group name in InstallerProfile.cfg
vi  InstallerProfile.cfg
Put the following details:
oic_URL:https://host:port
agent_Group_Identifier: AGENT_GROUP

Step4:
java -jar connectivityagent.jar

proceeding to install a new agent
Enter your OIC username:
Enter password for user:
...
Done with Agent installation & Configurations... Starting Agent for message processing.
Agent started successfully...Now available for new message.

Now go to the OIC agents and see 1 connectivity agent is created under Agent_GROUP. If you go to the Monitoring agents, you will see the agent is active in green.
No go the linux page and ctrl +c to shutdown it. and you will see the agent in red monitoring agent.

To run the connectivity in background.
nohup java -jar connectivityagent.jar &

and also add the oic_user and oic_password in the InstallerProfile.cfg file.
oic_user=oicuser
oic password=welcome

Start/Stop Connectivity Agent:

Start:
nohup java -jar connectivityagent.jar &

Stop:
Go to agenthome 
cat pid
5160
kill -9 5160

Log files of Connectivity Agent:
cd agenthome/logs
ls -ltr

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...