About FTP Adapter Use Cases

The FTP Adapter can be used in the following scenarios.

FTP Adapter to Oracle ERP Cloud Adapter Integration

This use case describes how to load data from a secure FTP location to Oracle ERP Cloud by using a trigger file mechanism. The data is sent to Oracle Integration for orchestration. Oracle Integration schedules the integration flow for polling the trigger file.

  • Create an orchestrated integration that is triggered by a schedule.

  • From the Invoke palette, drag an FTP Adapter into the integration canvas.

  • Configure the FTP Adapter to perform the following tasks:

    • Specify a name of readTriggerFile.

    • Specify a file name pattern of *.TRG.

    • Specify an input directory from which to read a trigger file.

    • Define a schema from a CSV file as the trigger file format.

  • From the Actions panel, add an Assign action below the FTP Adapter to declare the set of variables.

    • Specify a name of ExtactFileName.

    • In the Expression Builder, configure variables, such as extracting the ZIP file name of *.TRG from a relative path.

  • Add a second invoke FTP Adapter below the Assign action to download and stage the file temporarily in Oracle Integration.

  • Configure the FTP Adapter to perform the following tasks:

    • Specify a name of DownloadFile.

    • Select the Download to ICS operation.

    • Specify the input directory and download directory path.

    • Select the Unzip the File option.

      A mapper is automatically added to the integration whenever a Stage File action or new endpoints such as the FTP Adapter are added to the integration. The mapper appears between the Assign action and the DownloadFile FTP Adapter.
  • In the mapper, map the source extracted ZIP file to the target DownloadFileToICS filename element.

  • Because the ZIP file may contain multiple files, drag a For-Each action below the DownloadFIle FTP Adapter in the integration. This action enables iteration over a repeated element.

  • Specify the repeating element and current element name.

  • To read each file from the input directory, add a Stage File action below the For-Each action and configure it as follows:

    • In the Expression Builder, specify the file name and directory from which to read the file.

    • Specify the schema file by loading a CSV file that contains the data structure.
  • When a file is staged in Oracle Integration, add a second For-Each action below the Stage File action to iterate through each record.

    • Add the repeating element and current element name.

  • Add a second Stage File action to write each record into a new file.

    • Specify a name of WriteRecordToFile.

    • In the Expression Builder, set the name and the output directory. All the enriched data is appended to the staged file. The schema file for the new ERP file uses the same structure as the source file.

  • Perform the data mapping and transformation in the automatically added mapper. Functions, operators, and XSLs are useful to enrich and transform the new file for ERP.

  • Add a Stage File action below the WriteRecordToFile Stage File action to write a manifest file with the business data details.
    • Specify a name of CreateManifest.

    • In the Expression Builder, select the Write File option and Append to Existing File.

  • In the mapper that is automatically created above the CreateManifest Stage File action, define the manifest file content.

  • Add a Stage File action below the CreateManifest Stage File action to rezip the file before sending it to the ERP cloud endpoint.

    • In the Expression Builder, select the ZIP Files option.

    • Select the zip file name to concatenate and the directory to zip.

  • Add an Oracle ERP Cloud Adapter at the end of the integration to import the data into the ERP Financial application.

    • Select the Import Payable Invoices operation.

      Once the data loading and processing are complete, an email notification must be triggered.

    • Select Email Notification.

    • Define a callback to retrieve any details about failed records.

  • In the mapper above the Oracle ERP Cloud Adapter, define the file references for the endpoint so that the ERP system processes the rezipped file accordingly.

  • Activate the integration and monitor the activity stream from the Runtime Health page. The activity stream and diagnostic logs are available for download.

  • Save and activate your integration.

  • Invoke the integration.

  • Monitor the activity stream and the diagnostics log.

JSON to XML Special Character Conversion

If the JSON payload has special characters that are not valid in XML, those characters are replaced by a string when converted from JSON to XML.

For example, assume you have the following JSON payload:{ "_id": { "$oid": "52cdef7f4bab8bd67529c6f7" } }

You then select the JSON Sample payload format and <<inline>> to copy and paste the payload into the text field in the Adapter Endpoint Configuration Wizard.

In the mapper, the field $oid is represented with a string value of _0x646c72_oid.

The list of special characters and their corresponding XML conversion strings are as follows:

Special Character Converted Value Represented in the Mapper
" " _0x737063_
"/" _0x736c68_
"\\" _0x626c68_
":" _0x636c6e_
";" _0x73636e_
"(" _0x6c7072_
")" _0x727072_
"&" _0x616d70_
"," _0x636d61_
"#" _0x706e64_
"?" _0x717374_
"<" _0x6c7374_
">" _0x677274_
"start" _0x737472_
"@" _0x617472_
"$" _0x646c72_
"{" _0x6c6362_
"}" _0x726362_
"%" _0x706572_