Rabu, 21 Februari 2018

Custom function in ICS to extend transformation capabilities

There is always the limitation in the product we use in the IT and all the product do not fill all the requirements. That is the reason we use custom options to extend the capability of products.

Same way ICS is restricted to provide some out of the box function. But if these inbuilt functions don't meet the expectation then we always try to explore some custom program to meet the requirement.

So, in the release of ICS 17.2.5 onwards, ICS has introduced the capability of importing and using custom functions. These functions are created using JavaScript and can be used in transformations, expressions and as an action in Orchestrations.

Let's go forward and see how can we achieve this with the help of a simple example.

For this blog, we have created a simple javascript function which is used to add two integer variable and return the sum of these two.

function sum(first,second)
{
    var third = first+second
    return third;
}

To use this function, we have to register this as a library using ICS. Let's save this file with name sum.js and save it to the desktop machine.

Login into the ICS and navigate to the Designer -> Libraries

Click on the Register button 


Register Library popup will get open, provide information and click on Create button
  • Select Library File(.js/.jar): Select the sum.js file
  • Name: Give any library name
  • Identifier: Would be picked up automatically based on the Name entered. However, we can change it
  • Version: Library version
  • Description: Enter description

Before we can use functions within integrations and transformations we need to configure all functions we want to use. For instance, ICS needs to know the input and output types of the JavaScript arguments and in which components we want to make the functions available. In the current version (17.1.3 Early uptake) functions can only be made available in orchestrations, but in the future, we will see the ability to also use functions in transformations using XPath and by adapters.

In this case, the library only has one function name sum which has two integer input arguments (first, second) and one integer output argument (third). When configuring the arguments we can select between three basic data types; boolean, number and string.

Configure the library as shown in the below screenshot  and click on Save button


See the library has been registered successfully


Now we are good to go to use this custom Library in the Orchestration integration.

Let's move forward and create a REST service. This REST service will accept two arguments and produces the JSON output with a single output parameter.

Drop a Trigger REST connection on the canvas and configure the wizard
  • Enter below information and Click Next
    • Name of the endpoint: SumTwoValues
    • Relative URI(must start with /): /sum
    • Select HTTP verb: GET
    • Select Add and review parameter for this endpoint
    • Select, Configure this endpoint to receive the response checkbox: This option allows us to assign response payload in the next step
  • Add two Query parameter(first, second) of integer type and click Next
  • Select JSON sample radio button, Click on inline link and provide payload
{
                "sum":1
}

  • Drop Function Call activity between the REST adapter and mapper
  • Click on Function link
  • Select sum function
  • With the help of Expression builder, assign the query parameter(first, second) to the JS input variable
  • Edit the mapper and drag output_CallSumFun_third the variable and drop to sum variable
  • Activate the integration and hit REST service


Rabu, 03 Januari 2018

Using Oracle EBS Adapter in Integration Cloud Service

Oracle ICS provides Oracle E-Business Suite Adapter that provides native and secure connectivity to Oracle E-Business Suite instance. It lets us create integrations with EBS public integration interfaces.

We have written a dedicated blog on Oracle E-Business Suite Adapter that gives the detailed description of EBS adapter and it's capabilities.

In this blog, we'll show how to use E-Business adapter in an ICS integration to call custom services that are deployed on EBS ISG(Integrated SOA Gateway).

Let's create a scheduled integration in which we'll use the EBS adapter to call PL/SQL API.


Drop the EBS connection just below the schedule component from the Invokes tab. Please see the blog which describes how to create EBS connection


EBS connection configuration wizard will be opened. Enter the Endpoint name and click Next


Select the Product family from the Next screen. For this use-case, we'll select Human Resource Suite since our custom service relates to this product family.

Please see the blog on how to deploy custom services

Then select Human Resources Personnel from Product drop-down. These two selections totally depend on PL/SQL API deployed on ISG. For this information please check with the EBS consultant who has deployed the API on ISG.

Select the XX_SAVE_EMPLOYEE API which is being deployed on the ISG. In another blog, we have demonstrated how to deploy the PL/SQL API on ISG.


Now select the operation which we want to call. As of now we only have a single method (save_employee) in the API (XX_SAVE_EMPLOYEE ). Select the method and click Next button

Exposed method(save_employee) takes two input parameter(C_ID, NAME) and insert the same into the table(xx_test).

Click Done button on the summary page. Edit the mapper and see all the input parameter exposed in the operation(save_employee)


Map the input parameters as per the requirement.

Save and activate the integration.

These steps complete the integration and now it's time to test the integration. Once integration executed successfully, the data should be inserted into the table.