Show TOC

Using the Dispatcher: ExampleLocate this document in the navigation structure

Most of the adapters in the Adapter Engine include a dispatcher that can process a series of user exits for converting messages. For example, this dispatcher enables you to carry out file/FTP adapter conversions, XSLT transformations, or Java-based transformations either individually, or combinations of all three.

The example below describes how the dispatcher can be used.

You can find information on the migration of dispatcher classes for the Adapter-Engine (Java EE) in the Advanced Adapter Engine documentation under Inserting the MessageTransformBean in the Module Processor.

Example

A JMS message is sent to the Integration Server using the sender JMS adapter. The data appears in a list separated by semi-colons. It is converted to an XML document in the JMS adapter using the functions already available and used in the file/FTP adapter. This XML document can then be processed further by an individual XSLT stylesheet.

The following parameters must be set in the sender JMS adapter:

  • transformClass=com.sap.aii.messaging.adapter.trans.JMSSinglePayloadBinding

    You must specify this transformation class because the JMS payload only contains the data and no XI message.

    Note

    This parameter is only required for the JMS adapter and is therefore specific to this example.

  • Dispatcher.class=com.sap.aii.messaging.adapter.ConversionDispatcher
  • Dispatcher.namespace=namespace1

    Both these parameters activate the dispatcher function and set the namespace used to namespace1.

You can display the results of the individual conversion steps for test purposes by entering the following in the log file:

  • namespace1.ConversionDispatcher.logPayload=true

    namespace1 is the namespace specified above (the same applies for the parameters that follow)

The file/FTP adapter conversion routines and their settings are used because of the following entries (for further information about the individual settings refer to Configuring the Sender File/FTP Adapter):

  • namespace1.Service.1=Plain2XMLService

    Plain2XMLService is an arbitrary name.

  • namespace1.Plain2XMLService.class=com.sap.aii.af.sdk.xi.adapter.Conversion
  • namespace1.Plain2XMLService.xml.conversionType=SimplePlain2XML

    Depending on the processing mode, you can specify SimplePlain2XML, StructPlain2XML or SimpleXML2Plain as the value for this parameter.

  • namespace1.Plain2XMLService.xml.processFieldNames=fromConfiguration
  • namespace1.Plain2XMLService.xml.fieldNames=a,b,c
  • namespace1.Plain2XMLService.xml.fieldSeparator=;

The following entries in the conversion file then produce the subsequent XSLT conversion:

  • namespace1.Service.2=XSLTService

    XSLTService is also an arbitrary name.

  • namespace1.XSLTService.class=com.sap.aii.af.sdk.xi.adapter.XSLTConversion
  • namespace1.XSLTService.XSLTConversion.XSLTFileName=Data/DemoConversion.xsl

    In this example it is assumed that the stylesheet to be used has the name DemoConversion.xsl and that it is located in the subdirectory Data.