変換用のインバウンド・メッセージの分類

Decision Server Insights がインバウンド・メッセージを分類および変換するように、インバウンド・バインディングを拡張できます。

このタスクについて

XPath 式 (分類子) をインバウンド・バインディングに追加し、使用する .xsl 変換を指定し (該当する場合)、代替アクションを指定します。Decision Server Insights は、インバウンド・メッセージを分類子と照合します。メッセージが分類子に一致した場合、Decision Server Insights は .xsl 文書を適用してメッセージを変換します。メッセージがその分類子に一致しなかった場合、Decision Server Insights は、メッセージを後続の分類子と照合します。メッセージがいずれの分類子にも一致しなかった場合、指定した代替アクションに応じて、Decision Server Insights はメッセージを破棄するか、変換せずにメッセージを処理します。

メッセージ分類式では、メッセージ・コンテンツ以外の属性に基づいてメッセージを分類するために、MessageContext インターフェースによって定義した関数を使用できます。例えば、関数 context:getJMSType() は、JMS メッセージの JMSType プロパティーを返します。使用可能な関数について詳しくは、MessageContext を参照してください。

手順

  1. インバウンド・バインディングを作成します。 例:
    define inbound binding 'binding_name' 
       with 
          description "description",
       using 
          message format message_format,
       protocol protocol_type,
       accepting events: 
          - event
          - event.
  2. インバウンド・メッセージと照合する最初の分類子を指定します。 例:
    classifying messages:  
       if matches "xpath1"      
          then discard message 
       else if matches "xpath2"
          then do not transform message 
       else if matches "xpath3"      
          then transform using
          "transformation"  
       else      
          discard message
  3. XSL 変換を指定します。 例:
    transform using "xsl file"
       else if matches "XPath_expression"
          where prefix "prefix" represents the namespace "namespace"
          transform using "xsl_file"
       else alternate_action,
  4. 代替アクションを指定します。 分類子のいずれも true に評価されなかった場合、代替アクションにより、メッセージに対する処理が決まります。 例:
    else do not transform message
  5. バインディングの作成を終了します。 例:
    accepting events: 
          - event 
          - event. 
  6. 作業内容を保存します。

例

define inbound binding 'incomingQuotes' 
   with 
      description "Incoming quotes",
   using 
      message format application/xml, 
   protocol HTTP, 
   classifying messages: 
      if matches "/sources/source[@id='website']" 
         where prefix "company" represents the namespace "http://example.org""
         transform using "websiteTransform.xsl" 
      else if matches "/sources/source[@id='mobile']"
         where prefix "anotherCompany" represents the namespace "http://example.org"
         transform using "mobileTransform.xsl"
      else do not transform message, 
   accepting events: 
      - Existing quote 
      - New quote. 

次のタスク

インバウンド・エンドポイントを指定します。