While working with Oracle Integration Cloud (OIC) on a number of customer projects recently, I've come across a few handy tips and tricks to make life easier.
TIP-1 : Accessing Variables Across Scopes
If you need to access variables across scopes in OIC there are two options:
- Declare the variable outside of all scopes prior to using it. This option will not be possible when working with variables related to call outs situated within a scope as these variables are not manually declared by the developer. In this case option 2 is the only option.
- Use file staging to push the contents of the variable into a staged file which is then read outside of the scope in either another scope or the main flow.
TIP-2 : REST Adapter PATCH Verb Support
Currently the REST adapter only supports the use of the PATCH verb against API end points that use HTTP/S. No reason can be found for this but Oracle clearly states this limitation in its documentation.
There are two obvious ways to work around this limitation:
- Ensure the API endpoint in question uses HTTP/S
- If HTTP/S is not possible then the use of another verb is required.
TIP-3 : REST Inbound Message Size
The OIC REST adapter has a hard set 10MB limit in the size of a message that can be received by the adapter, either as a request input to an integration that uses the REST adapter for an application driven integration or as a response from a callout using the REST adapter.
To work around this limit for incoming requests:
- Clearly document in API documentation that there is a hard limit on the size of the request so that consumers are aware of the limitation and can take the necessary action either at design time or run time
To work around this limit for responses:
- The API that returns the response will need to limit it's response size. This can be achieved via the one of, but not limited to, the following options:
- The API returning a summary of the data (e.g. an identifier to lookup the data in subsequent calls, size of record set) and then making one or more calls to retrieve the data via a separate API that allows retrieving the data in ranges using the identifier returned in the first call.
- Updating the called API to support range searching on the original call so that only the required subset of records is returned.
TIP-4 : Convert CSV as String to XML
This post describes how to convert CSV content that you may have captured in a single string to XML for mapping purposes. The image below shows the overall process, as part of a larger process.
- Create a stage file action that will write a file.
- You will want to specify the structure of the contents of the file and provide an XML schema that contains the following:
<schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/opaque/" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="opaqueElement" type="base64Binary"/>
Use this file when setting the format of the file to be written.
- Implement the mapping to map the string containing the CSV content to the opaqueElement.
- Implement a stage file action to read the file staged in the previous steps.
- Specify the structure of the file to be read using a sample CSV file based on the contents you know will be returned.
- Use the output of this staged file read step to map appropriately.