Tuesday, September 15, 2026

OIC - Split Semicolon-Separated Values Using tokenize() in XSLT

Introduction

While developing integrations in Oracle Integration Cloud (OIC), we may receive a field containing multiple values separated by a delimiter such as a semicolon (;).

For example:

"ImpactedAccountID": [

  "5354181000",

  "7789253000;4889253000",

  "6823624000",

  "9235902000",

  "5091223000",

  "2279450000;3457280000;7236081000;7131391000",

  "7131391000",

  "7131391000",

  "3457280000",

  "5200100000"

]

In this scenario, simply looping through ImpactedAccountID will not split values such as:

7789253000;4889253000

into separate account IDs.

OIC XSLT provides the tokenize() function, which can be used to split a string based on a delimiter.

Use Case

We receive an incident payload containing an ImpactedAccountID array.

Some array elements contain a single account ID, while others contain multiple account IDs separated by semicolon (;).

Input

{

  "VoltageDipIncidentDate": "09-07-2026",

  "VoltageDipIncidentTime": "15:14",

  "IncidentID": "INC 1350000262",

  "ImpactedAccountID": [

    "5354181000",

    "7789253000;4889253000",

    "6823624000",

    "9235902000",

    "5091223000",

    "2279450000;3457280000;7236081000;7131391000",

    "7131391000",

    "7131391000",

    "3457280000",

    "5200100000",

    "5173284000",

    "4523013000",

    "3506184000",

    "4136450000",

    "3264642000"

  ]

}

Our requirement is to transform this into multiple individual accountId elements.

Solution

We can use the XSLT tokenize() function.

The basic syntax is:

tokenize(string, delimiter)

For our requirement:

tokenize(string(.), ';')

This tells XSLT: Take the current value and split it wherever a semicolon (;) is found.

XSLT Code

The following is the same logic used in the provided XSLT:

<xsl:for-each

    select="/nssrcmpr:execute/ns15:request-wrapper/ns15:ImpactedAccountID">

    <xsl:for-each select="tokenize(string(.), ';')">

        <ns23:accounts>

            <ns23:accountId>

                <xsl:value-of select="normalize-space(.)"/>

            </ns23:accountId>

        </ns23:accounts>

    </xsl:for-each>

</xsl:for-each>



How the Logic Works

There are two xsl:for-each loops.

1. Outer for-each

<xsl:for-each

    select="/nssrcmpr:execute/ns15:request-wrapper/ns15:ImpactedAccountID">

The outer loop iterates through every element of the ImpactedAccountID array.

For example, it receives values one by one:

5354181000

7789253000;4889253000

6823624000

9235902000

...

2. tokenize() splits the current value

Inside the outer loop:

<xsl:for-each select="tokenize(string(.), ';')">

Here: string(.) -- gets the current value.

The second parameter: ';' --defines the delimiter.

For example:

7789253000;4889253000

becomes:

7789253000

4889253000

Similarly:

2279450000;3457280000;7236081000;7131391000

becomes four separate values:

2279450000

3457280000

7236081000

7131391000

3. Create the Target Element

For every token, we create:

<ns23:accounts>

    <ns23:accountId>

        <xsl:value-of select="normalize-space(.)"/>

    </ns23:accountId>

</ns23:accounts>

The current token is represented by: .

Therefore:

<xsl:value-of select="normalize-space(.)"/>

writes the current account ID into accountId.

normalize-space() is useful to remove unnecessary leading/trailing whitespace.

Example

Suppose the input contains:

"ImpactedAccountID": [

    "5354181000",

    "7789253000;4889253000",

    "6823624000"

]

Processing

First iteration:

5354181000

tokenize() returns:

5354181000

Second iteration:

7789253000;4889253000

tokenize() returns:

7789253000

4889253000

Third iteration:

6823624000

returns:

6823624000

Output

The resulting XML will contain individual accountId values:

<ns23:accounts>    <ns23:accountId>5354181000</ns23:accountId>

</ns23:accounts>

<ns23:accounts>   <ns23:accountId>7789253000</ns23:accountId>

</ns23:accounts>

<ns23:accounts>    <ns23:accountId>4889253000</ns23:accountId>

</ns23:accounts>

<ns23:accounts>   <ns23:accountId>6823624000</ns23:accountId>

</ns23:accounts>

Output for the Provided Sample

For the provided input, values such as:

7789253000;4889253000

are converted to:

<ns23:accounts>   <ns23:accountId>7789253000</ns23:accountId>

</ns23:accounts>

<ns23:accounts>   <ns23:accountId>4889253000</ns23:accountId>

</ns23:accounts>

And:

2279450000;3457280000;7236081000;7131391000

becomes:

<ns23:accounts>  <ns23:accountId>2279450000</ns23:accountId>

</ns23:accounts>

<ns23:accounts>   <ns23:accountId>3457280000</ns23:accountId>

</ns23:accounts>

<ns23:accounts>   <ns23:accountId>7236081000</ns23:accountId>

</ns23:accounts>

<ns23:accounts>  <ns23:accountId>7131391000</ns23:accountId>

</ns23:accounts>

Complete Logic in Simple Terms

The complete processing can be understood as:

ImpactedAccountID array

        ↓

Outer for-each

        ↓

Pick one value

        ↓

Check/Split using tokenize()

        ↓

Delimiter = ;

        ↓

Create accountId for every token

        ↓

normalize-space()

        ↓

Final XML

Key XSLT statement

tokenize(string(.), ';')

means: Split the current string wherever ; occurs and process each resulting value separately.

Conclusion

The tokenize() function is very useful in OIC when an incoming field contains delimiter-separated values.

Instead of manually manipulating the string, we can use:

<xsl:for-each select="tokenize(string(.), ';')">

This approach allows OIC to handle both:

5354181000

and:

7789253000;4889253000

using the same XSLT logic.

Important: The outer for-each handles the original ImpactedAccountID array, while the inner for-each handles the individual values produced by tokenize().

Saturday, September 5, 2026

OIC Utility service - Project & Connection Status Monitoring Using Factory APIs

OIC Project & Connection Status Monitoring Using Factory APIs

Overview

This solution automates OIC project and connection health monitoring using OIC Factory APIs.

The integration outlines:

  1. Retrieves all projects configured for monitoring.
  2. Retrieves connections for each project.
  3. Checks the status of every connection.
  4. Generates a consolidated CSV report.
  5. Calculates Success/Failure counts.
  6. Sends an email with the summary in the email body and the detailed report as an attachment.

High-Level Flow

Scheduler

    |

MAIN Integration

    |

Get Project List

    |

For Each Project

    |

Get Connections

    |

For Each Connection

    |

Get Connection Status

    |

Append Result to Report

    |

Calculate Success/Failure Count

    |

Send Email

   / \

Body  CSV Attachment

Detailed flow:

Scheduler Integration

Integration: SCH_Project_Connection_Monitor

The Scheduler integration triggers the Main integration based on the configured schedule.

SCH--> Invoke --> MAIN

Main Integration

Integration: MAIN_Project_Connection_Monitor

The Main integration performs the complete monitoring process.

Step 1 – Get Projects

Project information can be maintained/configured through an OIC Lookup.

MAIN >> Read Project Lookup >> Get Project List

The project list is then processed one by one.




Step 2 – Get Connections

For each project, invoke the OIC Factory API to retrieve its connections.

For Each Project >> Get Connections





Note: Here. We have have used hasmore looping concept as it can have huge nunber of projects.

Step 3 – Get Connection Status

For every connection, invoke the Factory API and capture the status. >> write into a file >> read the content >> apend each connection status 

Example:

Project       Connection             Status

------------------------------------------------

HCM_PROJECT   HCM_REST_CONNECTION    SUCCESS

HCM_PROJECT   UCM_CONNECTION         FAILURE

ERP_PROJECT   ERP_REST_CONNECTION    SUCCESS










For scope fault:









Step 4 – Generate Report

Append each connection result to a CSV file using the OIC Stage File action.

Project Name,Connection Name,Type,Status

HCM_PROJECT,HCM_REST_CONNECTION,REST,SUCCESS

HCM_PROJECT,UCM_CONNECTION,REST,FAILURE

ERP_PROJECT,ERP_REST_CONNECTION,REST,SUCCESS


Step 5 – Calculate Counts

Maintain counters during processing:

Total Projects

Total Connections

Success Count

Failure Count

Logic:

IF Status = SUCCESS

    SuccessCount++

ELSE

    FailureCount++

The processing continues even if an individual connection fails.







5. Email Notification

After all projects and connections are processed, send an email.

Email Body

OIC Connection Health Report


Execution Date    : 05-Sep-2026

Total Projects    : 5

Total Connections : 32

Successful        : 29

Failed            : 3

Overall Status    : FAILURE


Please find the detailed report attached.

The generated CSV report is attached to the email.

Example:

OIC_Connection_Status_20260905.csv









EmailBody:

<tr style="background-color:#D9EAF7;">

    <th>Project Identifier</th>

    <th>Success Count</th>

    <th>Failure Count</th>

</tr>


fn:concat($EmailBody,

'<tr>',

'<td>',$fO_project/ns22:project/ns22:ProjectIdentifier,

'</td>',

'<td style="color:green;font-weight:bold;text-align:center;">',

$fO_project/ns22:project/ns22:Success,

'</td>',

'<td style="color:red;font-weight:bold;text-align:center;">',

$fO_project/ns22:project/ns22:Failure,

'</td>',

'</tr>'

)


Benefits

This provides a single automated health report for the OIC environment without manually checking projects and connections. It can easily be extended to include failed connection details, error messages, environment name, project-wise counts, HTML email tables, and Teams/Slack notifications.

Wednesday, September 2, 2026

OIC - Calculate Difference Between Two Dates in Minutes

 In Oracle Integration Cloud (OIC), we may need to calculate the time difference between two date/time values and return the result in minutes.

Input Format

The Start Time and End Time are received in:

yyyy-MM-dd HH:mm:ss

Example:

Starttime: 2026-09-02 10:15:00

Endtime:   2026-09-02 11:45:00

XSLT Expression

Use the following expression in the OIC mapper:

xsd:integer(

  (

    xsd:dateTime(

      concat(

        replace(/nstrgmpr:execute/ns18:request-wrapper/ns18:endtime, " ", "T"),

        ":00"

      )

    )

    -

    xsd:dateTime(

      concat(

        replace(/nstrgmpr:execute/ns18:request-wrapper/ns18:starttime, " ", "T"),

        ":00"

      )

    )

  )

  div xsd:dayTimeDuration("PT1M")

)


How it works

  • replace() changes the space between date and time to T.
  • xsd:dateTime() converts the value into a date/time.
  • End Time is subtracted from Start Time.
  • xsd:dayTimeDuration("PT1M") represents 1 minute.
  • div converts the duration into the number of minutes.
  • xsd:integer() returns the final result as an integer.

Example

Start Time: 2026-09-02 10:15:00

End Time: 2026-09-02 11:45:00

Result: 90 minutes


This is useful when an OIC integration needs to calculate processing time, elapsed time, SLA duration, or execution duration between two timestamps.

Featured Post

OIC - Split Semicolon-Separated Values Using tokenize() in XSLT

Introduction While developing integrations in Oracle Integration Cloud (OIC), we may receive a field containing multiple values separated by...