Enter your keyword

post

Change connection in the Integrations: Oracle Integration Cloud

There is the situation where we are required to replace the connection in the integrations. Integration cloud doesn’t allow to change the connection from the integration canvas directly. So in this blog, we’ll demonstrate two ways to solve this problem which will help us to easily switch the connection in the integrations.

Before we proceed further, let me explain the use case where we may require to change the connection in the integrations:

  • Let’s suppose we have 10 integrations which are using the single DB connection and the name of the connection is DB_Conn. Considering, in the DB_Conn, we had configured the standard DB schema called apps. Later we realize the 5 integrations should not use standard schema to compile the package or procedures and should use some custom schema (custom_user). Then, in that case, we will have to create one more DB connection with the different name and configure custom_user and then use the DB connection in these 5 integrations.
  • We want to clone the integration and in the cloned integration wanted to use different connection
  • We are migrating the integration which uses one REST connection with name REST_Sample but we have REST connection on the different instance with a different name called REST_Conn
Below limitation need to keep in mind before we replace the connection
  • The integration should not be in locked or activate state
  • Only the connection of the same adapter type can be replaced. For example, if we have an integration using the REST adapter then we can’t replace the connection of the SOAP adapter type.
There are two ways to replace the connection in the integrations.
  1. Export the integration and change the connection name in the project.xml file directly and then import
  2. Use Integration Cloud REST APIs to replace the connection
Let’s get started and achieve both the ways to replace connection.
For this use case, we are considering below:
  • We have two connection of the REST adapter type with below names and having the role as the trigger
    • REST_Sample
    • REST_Conn
  • Created an integration with name Sample_Integration which initially uses the connection REST_Sample. You can see the connection name by hovering on the adapter
Approach-1 ) Export the integration, replace the connection name in the project.xml and then import back
  • Export the integration by clicking the hamburger menu parallel to the integration
  • Open the .iar file directly in the 7-zip
  • Navigate to the icspackageprojectSAMPLE_INTEGRATION_01.00.0000PROJECT-INF directory
  • Open the project.xml file and see the REST_SAMPLE. REST_SAMPLE is the REST adapter connection identifier
  • Replace the REST_SAMPLE with REST_CONN  which is another REST adapter connection identifier
  • Save the file and import the integration using the Import button
  • Hover the mouse over the connection and see the integration should show REST_Conn
Approach-2) Using Oracle Integration Cloud REST API
  • First, we will get the details of the Integration (Sample_Integration) using the GET REST API using POSTMAN tool
  • Notice the “dependencies” element in the response. It’s showing the connection (REST_CONN) used in the Integration
  • Now, we’ll use the update REST APIs to update the connection. Here we’ll update the REST_CONN with REST_SAMPLE. Below are the details of update API
URL: /ic/api/integration/v1/integrations/{id}
Headers:

Authorization: Basic EncodeBase64({username}:{password})
X-HTTP-Method-Override: PATCH
Content-Type: application/json
HTTP Verb: POST
Body:

{
“dependencies”: {
        “connections”: [
            {
                “id”: “REST_SAMPLE
            }
        ]
    }
 }

  • Go back to the Integration list page,  hover the mouse over the connection and see the integration should the “REST_Sample” connection

Some Toughts (4)

  1. added on 7 Feb, 2019
    Reply

    Hi Ankur,

    I have replaced the connection but import the integration using the Import button facing below issue.

    Error while retrieving the integration. [Cause: ICS-20593]
    Unable to retrieve the existing integration instance from the config store.
    Unable to import the selected file as its not valid.

    please suggest. jaya

  2. added on 15 May, 2019
    Reply

    Hi Ankur,

    I am following Approach-1, But when I tried importing the same integration, ICS is throwing an error as mentioned below.

    Error while importing the integration. [Cause: ICS-20922]
    Validation of flow definition / project model has failed.

  3. added on 18 May, 2019
    Reply

    Hi,
    This is generic error. See the AdminServer logs.

    Regards,
    Ankur

  4. added on 24 Jun, 2019
    Reply

    Hi,

    Thanks for this! The modification in the Project.XML works fine except for SOAP Connections. When I update in Project.xml for any SOAP connections it will import but the SOAP Connection is not viewable, will say "An error occurred while retrieving connection "{0}". [Cause: ICS-11311]". I am assuming it is because the SOAP connection creates wsdl and jca in project which also needs updating ?

    I tried updating those files as well, but still get same error ?

Leave a Reply

Your email address will not be published.