Wednesday, April 30, 2025

OIC - How to skip File Processing Excluding Hong Kong Public Holidays in Oracle Integration Cloud Using 1823 API

Use Case:

When processing data files through Oracle Integration Cloud (OIC), certain business operations must be skipped on public holidays. To automate this, we want to check whether a file's processing date falls on a Hong Kong public holiday using the 1823.gov.hk public API. If it is a holiday, the integration should stop gracefully.

API used: Https://www.1823.gov.hk/common/ical/en.json

Solution Overview:

We will implement the following in Oracle Integration Cloud (OIC):

  1. Create a REST connection to consume the Hong Kong 1823 Public Holiday API.
  2. Fetch and parse the public holiday list.
  3. Compare the input fileProcessingDate with the holiday list.
  4. If it is a holiday, stop the integration using a Switch action.

Step-by-Step Implementation:

1. Create REST Connection in OIC

  • Go to Connections > Create > Choose REST Adapter.
  • Set the name (e.g., HK_PublicHoliday_API).
  • Set the connection URL:
    https://www.1823.gov.hk
  • Security: Select “No Security Policy”.
  • Test and save the connection.

2. Build the Integration

  • Create a new Scheduled Integration.
  • Add a Schedule Parameter: fileProcessingDate (type: date or string in yyyy-MM-dd format).
  • Add an Invoke action to call the REST Connection created earlier.
    • Method: GET
    • URI: /common/ical/en.json
    • Configure the response JSON to capture the public holiday data.




3. Add a Switch Action

  • Put Condition: fn:count($GetHKHolidayList/ns96:executeResponse/ns95:response-wrapper/ns95:vcalendar/ns95:vevent/ns95:dtstart[self::node()= /ns91:execute/ns88:request-wrapper/ns88:ProcessRequest/ns88:FileProcessingDate]) > 0
    • If condition matches: add a stop action which will stop to proceed further.

5. Test the Integration

  • Test with various fileProcessingDate values including a known public holiday (e.g., 2025-01-01) and a regular working day.
  • Confirm that the integration stops only on public holidays.


No comments:

Post a Comment

Featured Post

OIC - OIC Utility to Reprocess Failed Real-Time Integration JSON Payloads

📌 Use Case In real-time OIC integrations, JSON payloads are exchanged with external systems via REST APIs. When such integrations fail (du...