Start of Content Area

This graphic is explained in the accompanying text Using the Dispatcher: Example  Locate the document in its SAP Library 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.

For more information about migrating dispatcher classes for the J2EE Adapter Engine, see: Migrating Dispatcher Classes of the J2SE Plain Adapter Engine

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

 

 

 

 

End of Content Area