Use Case:
In Oracle Integration Cloud (OIC), there is often a need to dynamically determine the Relative URI while invoking REST APIs. This is particularly useful in scenarios where integration flows must interact with multiple endpoints or services based on dynamic parameters, such as job names, document IDs, or other runtime variables.
Example Scenario:
A bulk data export integration requires a lookup of specific job names and their corresponding endpoint URIs dynamically during runtime. The target REST API expects the Relative URI to change based on the job being processed, ensuring the correct endpoint is invoked.
Solution:
To achieve this, you can use the lookupValue function within the OIC mapper to resolve the required Relative URI dynamically. Here's how:
1. Setup a Lookup Table in OIC:
Create a lookup table in OIC with columns for "Job Name" and "Integration URL". Populate the lookup with key-value pairs for job names and their corresponding relative URIs.
2. Configure the Mapper:
In the mapper, map the required source variable (e.g., Var_JobName) to the target Relative URI field.
Use the lookupValue function to fetch the URI dynamically based on the job name.
Syntax:
lookupValue("Lookup_Name", "JobName", Var_JobName, "IntegrationURL", "Default_Value")
The dynamic uri which we will be passing from lookup , is as below format:
/ic/api/integration/v1/flows/rest/<integrationIdentifier>/1.0/
Limitation:
All the REST APIs being invoked dynamically must have the same request and response payload structures to ensure seamless mapping and processing in the integration.
Invoke local Integration
The same functionality can be achieved using the "Invoke Local Integration" action when calling multiple local integrations. However, this requires all the local integrations to share the same request and response payload structures for consistent processing.
We have to pass integration code(identifier)and version dynamically from the lookup.
No comments:
Post a Comment