Event Sending and Consumption

Implementation of a certain integration use case might require Oracle Insurance Gateway storing events on regular basic and handle them together on a schedule for downstream systems to consume such payloads.

Oracle Insurance Gateway supports out of the box feature to store events and consume them using Event Integration Point and predefined dynamic logic methods respectively.

Use Case

Storing Financial Message from Policies and consume them on a daily basis to send to Financial Systems.

This use case requires two-fold process:

  1. Storing Events(financial message) throughout the day

  2. Consuming these events with the help of an integration scheduled to run daily at a certain time.

Storing Financial Messages

To store the financial messages, the endpoint on the Policies end to send the financial message to should be targeted to the event store integration point in Oracle Insurance Gateway

Example: "http://<OIG Host and Port>/<OIG Context Root>/events/financialMessages"

In this URL, 'financialMessages' is the eventType.

Consuming Financial Messages

To consume the financial messages, an integration needs to be configured that should have in the least one integration step:

  • Delivery Step: This step will read the events with type financialMessages, transform them to a format understood by the downstream systems and store them as a message. Then it will deliver the stored message to the downstream system.

As building blocks, following is needed:

  • Destination:

Fields Configuration

code

financialMessageDestination

credentialKey

target_user

addressKey

address.key.financialmessage.url, for example,

http://financialapps:8080/messages

destinationType

REST

typeConfig

path: /

httpMethod: POST

  • Dynamic Logic to read stored messages and transform them. Consider the financial message source payload structure and final structure to be as follows:

Transforming from Transforming to
<financialMessage
id="123"
invoiceId="234"
debitAmount= "123.234">
</financialMessage >
<messages>
<message>
 <accountingDetails
   id="123"
 amount="123.234">
</accountingDetails>
</message>
</messages>

Sample dynamic logic to read and convert events.

reader = eventReader("financialMessages")
def writer = new StringWriter()
def xml = new groovy.xml.MarkupBuilder(writer)
xml.messages{
 reader.readUnhandledEvents().each { event ->
 message {
 accountingDetails(
 id: financialMessage.@id.text() ,
 amount: financialMessage.@debitAmount.text())
 }
}
}
return writer.toString()