This article explains how to dynamically select and switch REST Adapter connections at runtime in Oracle Integration Cloud (OIC).
1. Create REST Connections
Create two separate REST connections in your OIC instance, each configured with a different Fusion instance URL.
Use this article to create connections.
2. Configure the Trigger InterfaceCreate a new integration and add an input query parameter to the trigger endpoint so the caller can specify which target environment to use.
3. Define a Connection Identifier VariableCreate an integration variable to store the target connection identifier dynamically.
4. Assign Connection Identifier via Switch CaseUse a
Switch activity to evaluate the input query parameter and assign the appropriate connection identifier to your variable (e.g.,
HP_REST_TEST_1 or
HP_REST_TEST_2).
5. Configure the REST Adapter EndpointAdd the REST Adapter Invoke connection and configure it to fetch sales orders using the following relative resource path:
/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub
6. Enable Dynamic ConnectionIn the REST endpoint configuration, check the
Enable Dynamic Connection option and map your connection identifier variable to it.
7. Define Query Parameters Configure endpoint query parameters such as limit and onlyData.
In the mapper, map limit to 10 and onlyData to true.
Test the integration by passing different instance values as the input query parameter:
Test Case 1: Pass the parameter for TEST1. Observe that OIC dynamically routes the call using the HP_REST_TEST_1 REST connection.
Test Case 2: Pass the parameter for TEST2. Observe that OIC dynamically routes the call using the HP_REST_TEST_2 REST connection.