Wednesday, 16 August 2017

Salesforce integration in Oracle Integration Cloud Service

In this article, we will show you to create an integration with Salesforce.

Use case description
  • Expose a REST service(Source) that takes five input parameters(first name, last name, designation, employee id, and band)
  • Check employee already exist in Salesforce based on employee id. If exists, update employee details else create a new employee
  • Send the response back to REST service caller
Pre-requisites:
  • REST service connection: Rest service connection should already be created in ICS. If not, please follow the blog
  • Salesforce connection: Salesforce connection should already exist in ICS. If not, please follow the blog
  • Salesforce custom object: Ask the Salesforce team to provide the custom object which will be used to send above employee details.
Let's go in deep and see how to use Salesforce custom object to send employee details in ICS.
  • Login into ICS and click on Integration tile from home page
  • Click on the Create button from the upper right corner
  • Select the Orchestration pattern from the dialog box
  • Enter Below information and click on Create button
    • Select Application event or business object radio button
    • Enter Integration Name in What do you want to call your integration text box
    • An Identifier would be picked up automatically from Integration name however you can edit it
    • Keep the Version as it is
    • Enter the description What does this integration do box
    • Leave the package box as it is
  • Drag the TEST_REST_Conn Connection on the canvas from REST connection
  • Enter below information and Click Next
    • Name of the endpoint
    • Relative URI(must start with /)
    • Select HTTP verb
    • Select Configure a request payload for this endpoint checkbox- This option allows us to assign sample request payload in the next step
    • Select Configure this endpoint to receive the response checkbox- This option allows us to assign sample response payload in the next step
  • Select JSON Sample Radio button: This option allows us to take input in JSON format. Select inline link to give sample payload 
  • Enter below payload and click OK
{  
   
"employeeId":"ABC@123",
   
"firstName":"Ankur",
   
"lastName":"Jain",
   
"band":"3",
   
"Designation":"Sr. Manager"
}

  • Below step allows us to configure sample response payload. Select JSON radio button and click inline link
  • Enter below payload and click OK
{  
   
"status":"response"
}

  • Click Done button
  • Let's drop TEST_SFDC connection that we created in the blog just below the PostEmployee Map
  • Enter Name in What do you want to call this endpoint text box and leave other option as it is and click Next button
  • Enter below information as below
    • Select SOQL(Salesforce Query Language) from Select an Operation Type drop down. We have selected this option as we would like to enter the Salesforce query to check whether the employee already exist or not
    • Enter below SOQL query. Custom_User__C is the Salesforce custom object which is used to store employee details. Id is the unique id of each record generated by Salesforce on new record inserted. Oracle_HR_ID__C is the field which is used to store employee id.

 select id, ORACLE_HR_ID__c from Custom_User__c where  ORACLE_HR_ID__c='&employeeId'


  • Click Next and Done button
  • Click on GetEmployeeDetails map and click Edit button


  • Map employeeId to employeeId as shown in the below screenshot. Click the Validate and Close button
  • Drop Switch activity from Action tab and drop just below the GetEmployeeDetails connection
  • Click on 1st activity and click Edit button
  • Expand $GetEmployeeDetails -> queryResponse -> QueryResults and drop size parameter to New condition input box. Enter 0 as the value. It means, if the employee will not exist in the Salesforce, the value of size will be 0. Click the Validate button and Close
  • Drop TEST_SFDC connection from Invoke tab as shown in the below screen shot
  • Enter Name in What do you want to call this endpoint text box and leave other option as it is and click Next button
  • Enter below information and click Next button
    • Select CRUD, create option from Select an Operation Type drop down
    • Search Custom_User__C object and Move to the right pane
  • Click Next and Done button
  • Click CreateEmployee map and edit button
  • Map source and target fields as shown below
  • Drag & Drop TEST_SFDC connection from Invoke panel as shown below
  • Enter Name in What do you want to call this endpoint text box and leave other option as it is and click Next button
  • Enter below information and click Next button
    • Select CRUDupdate option from Select an Operation Type drop down
    • Search Custom_User__C object and Move to the right pane
  • Click Next and Done button
  • Click UpdateEmployee map and edit button
  • Map source and target fields as shown below
  • Drop an Assign activity just below the PostEmployee connection and create a variable named employeeStatus. This variable will be used to set the employee status(created or updated)

  • Again, drop an Assign activity in if  block and select the same variable employeeStatus that we created in the previous step and assign the value created as shown in the screen shot
  • Again, drop an Assign activity in Otherwise block and select the same variable employeeStatus that we created in the previous step and assign the value updated as shown in the screen shot
  • Drop a Map activity just above the PostEmployee response
  • Edit the mapper and map employeeStatus to status
  • This is the last step to complete our integration. Let's add a tracking field as we always do in all the integration to track the Integration instance.
  • Click on Action menu and select Tracking option
  • Drag employeeId to the right panel and click Done button
  • This completes our integration and it looks like below
  • Let's activate the integration and test it using POSTMAN tool. If you don't' know how to activate the integration then please see Activate Integration step in the blog
  • Let's test it using POSTMAN tool
    • Open POSTMAN tool
    • Enter Service end point
    • Add Basic Auth as ICS service is by default secured. We need to provide ICS console credentials.
    • Enter payload and hit Submit button

See the response, it say's created. It means a new employee has been successfully created.
  • Let's hit the same request again and see the response

See the response, it say's updated. It means already existing employee has been updated.


Tuesday, 15 August 2017

Oracle E-Business Suite Adapter in Oracle Integration Cloud Service

The Oracle E-Business Suite Adapter is one of the most popular adapter in Oracle Integration Cloud Service. Oracle E-Business Suite is commonly used in most of the big organization and all they all want to communicate EBS with all the applications running in the organization.

The Oracle E-Business Suite Adapter is one of many predefined adapters included with Oracle Integration Cloud Service allowing us to securely connect and use Oracle E-Business Suite services in integrations in Oracle Integration Cloud Service.


 Other important links



Capabilities of EBS adapter
  • Support inbound and outbound integrations
  • It is used to call PL/SQL API
  • The Oracle E-Business Suite Adapter supports outbound integrations with concurrent programs from Oracle Integration Cloud Service when adding the Oracle E-Business Suite Adapter as invoke (target) connections.
  • When Oracle E-Business Suite Adapter used as trigger (source) connections, business events are available for inbound integrations in Oracle Integration Cloud Service.
  • Similar to business events, XML Gateway messages are available for inbound integrations in Oracle Integration Cloud Service when adding the Oracle E-Business Suite Adapter as trigger (source) connections.
In this article, we'll show how to create EBS connection in Oracle ICS with On-Premise E-Business Suite.

Pre-requisite

  • EBS should be up and running
  • EBS console credentials
  • Required ports should be open between ICS agent and EBS: This is required if EBS suite resides in organization premises.
  • ICS agent should be up and running
Let's consider we already have all pre-requisite in place, so let's move ahead and create a EBS connection.
  • Login into the Oracle ICS
  • Select Connection tile from home page and select Create button from upper right side corner
  • Search Oracle E-Business Suite and Select the adapter
EBS Adapter Oracle ICS
EBS-1
  • Enter below information and click Create button
    • Enter Name
    • The identifier would be automatically picked up based on name entered however we can edit it.
    • Select Role as Trigger and Invoke depending on the requirement.
    • Enter Description
EBS Adapter Oracle ICS
EBS-2
  • Select Configure Connectivity button and enter below information and click OK button
    • Enter EBS Connection URL
EBS Adapter Oracle ICS
EBS-3
  • Select Configure Security button and enter below information and click OK button
    • Select Basic Authentication from Security policy drop down
    • Enter User Name
    • Enter Password
    • Enter Confirm Password
EBS Adapter Oracle ICS
EBS-4
  • Select Configure Agent button, select the Agent group from the popup and click Use button
EBS Adapter Oracle ICS
EBS-5

  • Now Click Test and Save button from the upper right corner
EBS Adapter Oracle ICS
EBS-6

If everything goes fine, the progress bar will reach 100 %.



Thursday, 10 August 2017

Oracle Integration Cloud Service Integrations

What is ICS integration

Integrations are the main ingredient of Oracle Integration Cloud Service. An integration includes at the least a trigger (source) connection (for requests sent to Oracle Integration Cloud Service) and invoke (target) connection (for requests sent from Oracle Integration Cloud Service to the target) and the field mapping between those two connections.

When we create the integrations, we build on the connections we have already created by defining how to process the data for the trigger (source) and invoke (target) connections.

Once our trigger (source) and invoke (target) connections are configured, the mappers between the two are enabled so we can define how the information is transferred between the trigger (source) and invoke (target) data structures for both the request and response messages.

Types of Integration

ICS allows us to create four types of integration. Here is the list of supported types of integration:



1) Basic Map Data: Such type of integration is very simple and allows us to flow data between two systems with the ability to add one additional enrichment call during request and response. For example, if you want send data from system A to B where the transformation is very straightforward then such type of integration would be very useful.

Basic Map Data
Basic Map Data

2) Orchestration: This type of integration allows us to create more complicated flows i.e invoking call to multiple systems, aggregating data and making some if/else flows decision based on the data we receive. Like Oracle Service Bus, these integrations are stateless.

This pattern allows us the following activities:
  • Assign
  • Map
  • Callback
  • Stop
  • Switch
  • Notification
  • For loop
  • While loop
Combining these allows us to create more complicated integrations.



3) Basic Publish To ICS: This is very fairly straightforward integration. It is like we are sending data in JMS queue.

4) Basic Subscribe To ICS: This is very fairly straightforward integration. It is like we are reading data from JMS queue.