Examples

Push Notification Scenario

Company Foo wants to push information to an external service every time a new policy is submitted. The service expects an XML file like:

Sample XML

<PolicyNotify>
<PolNum>Policy Number</PolNum>
<Amount>Policy Face Amount</Amount>
</PolicyNotify>

Service Definition

First, define the service in the service-registry.xml.

Service Registry Definition

<Service id="policyNotify" type="soap">
<TemplateName>PolicyNotify.ftl</TemplateName>
<WSDLLocation> http://www.foo.com/services/PolicyNotify?wsdl</WSDLLocation>
<ServiceName>{{+}http://www.foo.com/xml/PolicyNotify/+}PolicyNotifyService</ServiceName>
<ServicePort>{{+}http://www.foo.com/xml/PolicyNotify/+}PolicyNotifyServicePort</ServicePort>
</Service>

This defines a service with the policyNotify ID as a SOAP service. The WSDL specified must be accessible to the application server at runtime. The service name and port are taken from the WSDL and identify the component to be invoked.

Template Definition

Second, define the message template.

Message Template - PolicyNotify.ftl

<PolicyNotify>
<PolNum>${PolicyNumber}</PolNum>
<Amount>${FaceAmount}</Amount>
</PolicyNotify>

The template name specified in the <TemplateName> tag of the service description must match the name of the template file.

Since this is a template, the file should closely resemble the downstream format. Variables are introduced where content from OIPA is needed.

Extension Invocation

Third, call the extension from the OIPA configuration.

OIPA Transaction Configuration

<MathVariable VARIABLENAME="ServiceID" TYPE="VALUE" DATATYPE="TEXT">policyNotify</MathVariable>
<MathVariable VARIABLENAME="ReturnValue" TYPE="VALUE" DATATYPE="TEXT"></MathVariable>
<MathVariable VARIABLENAME="ErrorValue" TYPE="VALUE" DATATYPE="TEXT"></MathVariable>
<MathVariable VARIABLENAME="PolicyNotify" TYPE="PROCESS" NAMESPACE="com.oi.osc" OBJECT="MathPlugin" DATATYPE="OBJECT">
<!-- Required Parameters for every call -->
<Parameter NAME="service.id" TYPE="INPUT">ServiceID</Parameter>
<Parameter NAME="returnValue" TYPE="OUTPUT">ReturnValue</Parameter>
<Parameter NAME="errorValue" TYPE="OUTPUT">ErrorValue</Parameter>
<!-- Data Parameters -->
<Parameter NAME="PolicyNumber" TYPE="INPUT">PolicyNumber</Parameter>
<Parameter NAME="FaceAmount" TYPE="INPUT">FaceAmount</Parameter>
</MathVariable>

This sample configuration defines three new text variables to hold values for the call: one for the service ID and two for the return values. It assumes that PolicyNumber and FaceAmount are already defined prior to this definition.

Alternative Delivery—File

If Company Foo wants to leverage file delivery instead of SOAP, then the only configuration that needs to change is the service definition.

Policy Notify - File

<Service id="policyNotify" type="file">
<TemplateName>PolicyNotify.ftl</TemplateName>
<Directory>/opt/interfaces/policyNotify</Directory>
<FileNameType>Reference</FileNameType>
<FileName>PolicyNumber</FileName>
</Service>

This specifies the directory that should be used for output as well as some optional settings. The <FileNameType> element specifies that the filename is a reference to a provided value, in this case PolicyNumber. Since the directory is specific to the interface this should be alright. ReplaceExisting could also be added to allow for overwriting the file should the activity be reprocessed.

Alternative Delivery—JMS

If Company Foo wants to leverage JMS delivery instead of SOAP, then the only configuration that needs to change is the service definition.

Policy Notify - JMS

<Service id="policyNotify" type="jms">
<TemplateName>PolicyNotify.ftl</TemplateName>
<ConnectionFactory>jms/ConnectionFactory</ConnectionFactory>
<Destination>jms/Destination</Destination>
</Service>

JMS delivery only requires a ConnectionFactory and Destination reference. These are both JMS artifacts that are configured in the application server and bound to a JVM or cluster. If the destination is shared between interfaces, then consider setting the Priority flag to rank messages.

 

 

 

 

 

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. About Oracle Insurance | Contact Us