솔루션 연결 예

연결 정의(.cdef) 파일에 솔루션의 인바운드/아웃바운드 바인딩 및 엔드포인트를 정의합니다.

Decision Server Insights 연결 정의 편집기를 사용하여 .cdef 파일을 개발할 수 있습니다.

인바운드 연결 예

다음 예는 인바운드 메시지를 처리할 때 Decision Server Insights가 사용하는 바인딩 및 엔드포인트를 보여줍니다. http://quotesystem.company.com 서버는 HTTP 메시지를 Decision Server Insights에 게시합니다. 메시지가 처리되어 New quote 또는 Existing quote 이벤트가 생성됩니다. vehicleQuote 인바운드 바인딩은 .xml 및 HTTP를 인바운드 메시지의 허용된 형식 및 프로토콜로 정의합니다. variable1 엔드포인트는 메시지의 원본을 표현합니다.
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".

인바운드 바인딩을 확장하여 인식된 스키마를 따르지 않는 인바운드 메시지의 메시지 분류 및 변환을 제공할 수 있습니다. 이를 수행하는 경우, Decision Server Insights는 XPath 표현식에 대해 인바운드 메시지를 테스트하여 필요에 따라 다음 예에 표시된 대로 .xsl 변환 문서를 사용하여 메시지를 변환합니다.

인바운드 메시지:

<?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 변환:

<?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>

이벤트 스키마:

<?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>

생성된 이벤트:

<?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>

아웃바운드 연결 예

다음 예는 Claim details 이벤트를 메시지로서 직렬화하고 전송할 때 Decision Server Insights에서 사용하는 아웃바운드 바인딩 및 엔드포인트를 보여주며, 이는 다시 http://claims.example.org 서버에 게시됩니다. insuranceClaims 바인딩은 해당 이벤트 유형이 .xml 메시지로 직렬화되는지 보장합니다. insuranceClaimsOutbound 엔드포인트는 대상을 표현합니다.

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".