Sunday, January 26, 2020

Use case Scenarios File and FTP in OIC

Now let us look at a few example scenarios to see where these above mentioned “activities” can be used to design solutions. Here are some example scenarios

1. A source file of inventory records to be read from FTP and each record to be updated in target system using SOAP webservice

FTP Structured Read File:
This can be done using FTP Read File with schema of inventory record specified. For-Each construct can loop through each record to map to soap message and invoke soap webservice per record. Here is how it looks.
2. Accept a pdf file from source FTP and upload to a SOAP webservice as MTOM attachment

FTP Opaque Read File – SOAP MTOM:

FTP Read without specifying a schema will do the trick with opaque files. A FileReference object is available for mapping to target endpoint request.


FileReference can be mapped directly to the MTOM attachment, as shown below

3. Read a HDL file from vendor FTP and load it into Oracle Fusion HCM using UCM webservice as inline attachment
FTP Opaque Read File – SOAP inline attachment

The integration flow would look similar to Scenario.2 above.
The difference is in the mapping. The target UCM Webservice, in this case, expects an inline (base64encoded) attachment.
encodeReferenceToBase64 function converts File content to base64encoded string suitable for SOAP inline attachments
4. Read a zip file containing images and upload each image to a REST service as binary payload

FTP Download Unzip and Stage
The solution looks as above. The FTP Download file option with Unzip should be used.
Stage List activity and For-each can then be used to traverse through each image and post it to the REST service as raw payload (application/octet-stream) using the Generic Rest adapter
Stage List activity and For-each can then be used to traverse through each image and post it to the REST service as raw payload (application/octet-stream) using the Generic Rest adapter.
Same approach can be used even if passing the image file as multipart attachment.
5. Read a large file from FTP and process all records to a target database or ERP system
FTP stage Segment:
In this scenario we are assuming a file size of ~500MB. So using FTP Read is not recommended, the file would need to be downloaded using FTP “download file” option. Once the file is in Integration cloud file system, Stage option of “Read entire file” cannot be used as the file is larger than 10MB
Use the Segment Read option of Stage activity
Figures below show configuring “CRUD” operations on ERP Connection and choice of Business Object
A structured mapping like below helps map the read segment records into ERP payload
6. Read records over multiple REST calls, aggregate in local file and transfer file to remote FTP server
Aggregate file write
We have seen use cases for use of Stage Read and Stage Segment read. This scenario will show the utility of Stage Write file activity
The figure below shows a possible solution. REST endpoint calls are made within the while loop. Every response record is appended to a local file on Integration cloud using Stage File Write operation with an append option.

At the end of this file aggregation, Stage List Files operation is used to obtain a FileReference to this local file. Finally FTP Write or File Write can then be used to transfer the file to remote server.
Notice the use of the mapping function to convert FileReference to binary content, since we our remote Write file uses opaque schema.



No comments:

Post a Comment