Solution connectivity examples

You define the inbound and outbound bindings and endpoints for your solution in a connectivity definition (.cdef) file.

You use the Decision Server Insights connectivity definition editor to develop the .cdef file.

Inbound connectivity example

The following example shows the bindings and endpoints that Decision Server Insights uses when processing inbound messages. The http://quotesystem.company.com server posts an HTTP message to Decision Server Insights. The message is processed to produce a New quote or Existing quote event. The vehicleQuote inbound binding defines .xml and HTTP as the accepted format and protocol of inbound messages. The variable1 endpoint represents the origin of the messages.
define inbound binding 'vehicleQuote'
   with 
      description "Vehicle quotations",
   using 
      message format application/xml, 
   protocol HTTP, 
   accepting events: 
      - New quote
      - Existing quote. 
		
define inbound HTTP endpoint 'variable1'
   with 
      description "Inbound vehicle quotes from the web",
   using 
      binding 'vehicleQuote', 
   url path "/quotes/incoming".

You can extend an inbound binding to provide message classification and transformation for inbound messages that do not conform to a recognized schema. If you do this, Decision Server Insights tests inbound messages against an XPath expression, and transforms them, if necessary, with an .xsl transform document as shown in the following examples.

Inbound message:

<?xml version="1.0"?>
<event type="movement">
   <flight>SE36/XLF036</flight>
   <registration>F-GRSQ</registration>
   <altitudeFeet>36000</altitudeFeet>
   <course>253</course>
   <speedKnots>466</speedKnots>
   <longitude>2.56119</longitude>
   <latitude>49.0016</latitude>
</event>

XSL transformation:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns="http://www.example.org/FlightMovement"
   xmlns:context="com.ibm.ia.connectivity.context.MessageContextProvider">
   <xsl:output method="xml" indent="yes" />
   <xsl:strip-space elements="*" />
   <xsl:template match="/">
   <xsl:apply-templates />
   </xsl:template>
   <xsl:template match="event">
      <FlightMovement>
         <flight>
            <xsl:value-of select="flight" />
         </flight>
         <registration>
            <xsl:value-of select="registration" />
         </registration>
         <position>
            <latitude>
               <xsl:value-of select="latitude" />
            </latitude>
            <longitude>
               <xsl:value-of select="longitude" />
            </longitude>
            <speedKnots>
               <xsl:value-of select="speedKnots" />
            </speedKnots>
            <altitudeFeet>
               <xsl:value-of select="altitudeFeet" />
            </altitudeFeet>
            <course>
               <xsl:value-of select="course" />
            </course>
         </position>
      </FlightMovement>
   </xsl:template>
</xsl:stylesheet>

Event schema:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/FlightMovement" xmlns:tns="http://www.example.org/FlightMovement" elementFormDefault="qualified">

   <complexType name="FlightMovement">
      <sequence>
         <element name="flight" type="string"></element>
         <element name="registration" type="string"></element>
         <element name="position" type="tns:Position"></element>
      </sequence>
   </complexType>

   <complexType name="Position">
      <sequence>
         <element name="latitude" type="double"></element>
         <element name="longitude" type="double"></element>
         <element name="speedKnots" type="double"></element>
         <element name="altitudeFeet" type="int"></element>
         <element name="course" type="int"></element>
      </sequence>
   </complexType>
</schema>

Produced event:

<?xml version="1.0" encoding="UTF-8"?>
<FlightMovement xmlns="http://www.example.org/FlightMovement">
   <flight>SE36/XLF036</flight>
   <registration>F-GRSQ</registration>
   <position>
      <latitude>49.0016</latitude>
      <longitude>2.56119</longitude>
      <speedKnots>466</speedKnots>
      <altitudeFeet>36000</altitudeFeet>
      <course>253</course>
   </position>
</FlightMovement>

Outbound connectivity example

The following example shows the outbound bindings and endpoints that Decision Server Insights uses when serializing and sending Claim details events as messages, which are then posted to the http://claims.example.org server. The insuranceClaims binding ensures that those event types are serialized into .xml messages. The insuranceClaimsOutbound endpoint represents the destination.

define outbound binding 'insuranceClaims' 
   with 
      description "Outbound insurance claims binding",
   using 
      message format application/xml, 
   protocol HTTP, 
   delivering events: 
      - Claim details. 

define outbound HTTP endpoint 'insuranceClaimsOutbound' 
   with 
      description "Outbound insurance claims endpoint",
   using 
      binding 'insuranceClaims', 
   url "http://claims.example.org/claims/outbound".