Trigger, Invoke, and Trigger & Invoke in OIC REST Connections

Trigger, Invoke, and Trigger & Invoke in OIC REST Connections

In Oracle Integration Cloud (OIC), REST connections allow systems to communicate. You can configure a connection in one of three ways: Trigger, Invoke, or Trigger and Invoke.


Trigger: OIC acts as a server, exposing a REST API so that external systems can receive data. Example: Third-party service receiving data using OIC Rest API.



Invoke: OIC acts as a client, calling external REST services. Example: Fetching data from an external API like a CRM system.



Trigger and Invoke: OIC can both receive and send requests using the same connection, enabling two-way communication. Example: Receiving customer data and validating it via an external service in a single flow.


By understanding these roles, you can set up flexible and efficient integrations tailored to your needs. 

Read More »
Blogger Tricks
*/

How to Create a Sample REST API in Oracle Integration Cloud (OIC)

Let's create a sample REST API using OIC with below steps

Step1: Create REST connection

Step2: Create Integration by using REST connection

Step3: Configure parameters if any and response as well

Step4: Map the elements for response if required and validate

Step5: Activate the Integration and test

We need a REST connection to create REST API using OIC.

Navigate to Design --> Connections.



Create the connection using create button.


Select REST from the list of the adapters exists


Provide the Integration Name and Integration Identifier, click on create to proceed to next steps.

Select the security policy as Basic Authentication.



Test the connection.


Save the connection.



Go to Integrations.


Click on create button to create the integration.



Select Application to create REST API


Provide the Integration Name and Integration Identifier and click on Create button.


Select the REST connection that we created earlier and give the endpoint name and description.


Click and continue button and configure the REST trigger by providing the end point URI (/{name}) so that we can pass name as part of URL and consume it and select the "Configure this endpoint to receive the response" to send the response upon calling REST API.


Click on Continue button and no need to configure the trigger parameters in this screen.


Click on continue and click on inline to add the sample JSON format for response.




Click on continue


Click on Continue


Click on Finish


Open the mapper in Edit mode and create a target node for message element in response wrapper.


Enable the developer view.

Add the below concat function and drag and drop the name from the left pane.
concat("Hi ",/nstrgmpr:execute/nstrgmpr:TemplateParameters/ns14:name,", How are you?")


Validate the mapper.

Go back to the integration after validating the mapper.

Go to the business identifiers.


Drag and drop the name as business identifier and save the integration.




Go back to all integrations after saving the integration to active the integration.


 
Enable the debug option to verify the logs and click on activate.



Refresh to check the status of the integration.


Run the integration to test REST API.

Pass the value in name and run.


Observe the response of the API.


To test the API in other tools, click on the Endpoint metadata to get the REST API URL.




Read More »
*/

Browser Navigation issue in OAF

Usually this issue occurs when closing the popup window and moving to the next set of data of search results using table navigation bar.

Lets look at the snaps of the issue for reference.








Code which has issue:

String errorPage = "/ah/oracle/apps/aoc/AHOMUI/webui/AHOMErrorsPG&banner=home&addBreadCrumb=Y&ErrorId={@ErrId}";

String destinationURL = APPS_HTML_DIRECTORY + OAWebBeanConstants.APPLICATION_JSP + "?" + OAWebBeanConstants.JRAD_PAGE_URL_CONSTANT + "=" + errorPage;

OALinkBean errorsAdvLink = (OALinkBean)advResultsTabBean.findIndexedChildRecursive("ErrorAdv");

OABoundValueEmbedURL errorAdvJsWindow = new OABoundValueEmbedURL(errorsAdvLink, 

                                                                         "javascript:var win = window.open( '", 

                                                                         destinationURL, 

                                                                          "' , 'win', 'height=600,width=1000,left=80,top=250,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes'); win.focus();");

errorsAdvLink.setAttributeValue(oracle.cabo.ui.UIConstants.ON_CLICK_ATTR, errorAdvJsWindow);



To resolve this issue, we need to retain the application module in the popup page.


Solved code:


String errorPage = "/ah/oracle/apps/aoc/AHOMUI/webui/AHOMErrorsPG&banner=home&retainAM=Y&addBreadCrumb=Y&ErrorId={@ErrId}";

String destinationURL = APPS_HTML_DIRECTORY + OAWebBeanConstants.APPLICATION_JSP + "?" + OAWebBeanConstants.JRAD_PAGE_URL_CONSTANT + "=" + errorPage;

OALinkBean errorsAdvLink = (OALinkBean)advResultsTabBean.findIndexedChildRecursive("ErrorAdv");

OABoundValueEmbedURL errorAdvJsWindow = new OABoundValueEmbedURL(errorsAdvLink, 

                                                                         "javascript:var win = window.open( '", 

                                                                         destinationURL, 

                                                                          "' , 'win', 'height=600,width=1000,left=80,top=250,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes'); win.focus();");

errorsAdvLink.setAttributeValue(oracle.cabo.ui.UIConstants.ON_CLICK_ATTR, errorAdvJsWindow);

Read More »
*/

Assign SQL value to variable in shell script


Requirement is to get the emails list from value set and send an email using shell script.


Sample Shell Script:

#!/bin/ksh

#*******************************************************************************

# Name : HH_TEST_SHELL

# Date : 19-MAY-2023

# By : AskHareesh

# Description : Execute JAR File

#*******************************************************************************

MAILBODY="Hi Team,

Please find the attached report."

MAIL_SUBJECT="Sales Order Status Report"

LOGDIR="/test/dir/"

LOGFILE="SalesOrderReport.csv"

INSTANCENAME="DEV"


VALIDATEEMAILS=`sqlplus -s $FCP_LOGIN <<-BBB

set pages 0

set feedback 0

select LISTAGG(ffv.FLEX_VALUE, ',')

from  apps.FND_FLEX_VALUE_SETS ffvs, apps.fnd_flex_values ffv

where 1=1

and ffvs.flex_value_set_id = ffv.flex_value_set_id 

and ffvs.flex_value_set_name='ASK_HAREESH_TEST'

and NVL(ffv.enabled_flag,'N')='Y'

and TRUNC(sysdate) between TRUNC(NVL(ffv.start_date_active,SYSDATE)) AND TRUNC(NVL(ffv.end_date_active,SYSDATE))

/

  EXIT

BBB

`

(echo  "$MAILBODY") | mailx -s "$INSTANCENAME : $MAIL_SUBJECT" $VALIDATEEMAILS

Read More »
*/

Send an email with out attachment from shell script


Requirement is to send an email with out attachment using shell script.

Sample Shell Script:

#!/bin/ksh

#*******************************************************************************

# Name : HH_TEST_SHELL

# Date : 19-MAY-2023

# By : AskHareesh

# Description : Execute JAR File

#*******************************************************************************

MAILBODY="Hi Team,

Please find the attached report."

MAIL_SUBJECT="Sales Order Status Report"

VALIDATEEMAILS="askhareesh@gmail.com"

LOGDIR="/test/dir/"

LOGFILE="SalesOrderReport.csv"

INSTANCENAME="DEV"

(echo  "$MAILBODY") | mailx -s "$INSTANCENAME : $MAIL_SUBJECT" $VALIDATEEMAILS

Read More »
*/

Send an email from shell script with attachment


Requirement is to send an email with file as an attachment using shell script.

Sample Shell Script:

#!/bin/ksh

#*******************************************************************************

# Name : HH_TEST_SHELL

# Date : 19-MAY-2023

# By : AskHareesh

# Description : Execute JAR File

#*******************************************************************************

MAILBODY="Hi Team,

Please find the attached report."

MAIL_SUBJECT="Sales Order Status Report"

VALIDATEEMAILS="askhareesh@gmail.com"

LOGDIR="/test/dir/"

LOGFILE="SalesOrderReport.csv"

(echo  "$MAILBODY" ; uuencode $LOGDIR/$LOGFILE $LOGFILE) | mailx -s "$INSTANCENAME : $MAIL_SUBJECT" $VALIDATEEMAILS

Read More »
*/

Refresh parent window after closing popup window - OAF


Requirement is to refresh the parent window page to reflect the changes after closing the popup window page.

1. Put a javascript function on popup window page's body bean in process request to send the refresh event back to parent window page.

OABodyBean bodyBean = (OABodyBean)pageContext.getRootWebBean();

pageContext.putJavaScriptFunction("refreshParent", "function refreshParent() { opener.submitForm('DefaultFormName',1,{'actionEvent':'REFRESH_PARENT'}); window.close(); }");

OAButtonBean bean = (OAButtonBean)webBean.findChildRecursive("closeBtn");

if (bean != null) {

  bean.setOnClick("javascript:refreshParent()");

}


2. Consume the refresh event in the main/parent window page process form request and remove the event parameter

if("REFRESH_PARENT".equals(pageContext.getRenderingContext().getServletRequest().getParameter("actionEvent"))) 

   {

      pageContext.removeParameter("actionEvent");

      doSearch(pageContext, webBean); // This is a method to get the input parameters and execute view object along with where conditions

   }

Read More »
*/