Classifying inbound messages for transformation

You can extend an inbound binding so that Decision Server Insights classifies and transforms inbound messages.

About this task

You add an XPath expression (a classifier) to the inbound binding, specify the .xsl transformation to use where applicable, and specify an alternative action. Decision Server Insights tests inbound messages against the classifier. If a message matches the classifier, Decision Server Insights transforms the message by applying an .xsl document. If a message does not match the classifier, Decision Server Insights tests the message against subsequent classifiers. If the message does not match any of the classifiers, Decision Server Insights either discards the message or processes the message without transformation, depending on which alternative action you specify.

The message classifier expressions can use the functions that are defined by the MessageContext interface to classify messages based on the attributes other than the message content. For example: the function context:getJMSType() returns the JMSType property of a JMS message. For more information about the functions available, see MessageContext.

Procedure

  1. Create the inbound binding. For example:
    define inbound binding 'binding_name' 
       with 
          description "description",
       using 
          message format message_format,
       protocol protocol_type,
       accepting events: 
          - event
          - event.
  2. Specify the first classifier to test inbound messages against. For example:
    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. Specify the XSL transformation. For example:
    transform using "xsl file"
       else if matches "XPath_expression"
          where prefix "prefix" represents the namespace "namespace"
          transform using "xsl_file"
       else alternate_action,
  4. Specify an alternative action. If none of the classifiers evaluate to true, the alternative action determines what then happens to the message. For example:
    else do not transform message
  5. Finish creating the binding. For example:
    accepting events: 
          - event 
          - event. 
  6. Save your work.

Example

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. 

What to do next

Specify the inbound endpoints.