Start of Content Area

Function documentation MessageTransformBean, Migrating Dispatcher Classes  Locate the document in its SAP Library structure

Use

The plain J2SE Adapter Engine gives you the option of using external Java classes to modify the payload of an XI message for various adapters. To do this, the Java classes must have implemented a Transform Java interface.

To make these classes available for the corresponding adapter types in the J2EE Adapter Engine as well, the module AF_Modules/MessageTransformBean is shipped with the module processor. This module makes it possible to call the classes written for the plain J2SE Adapter Engine.

The classes com.sap.aii.messaging.adapter.Conversion and com.sap.aii.messaging.adapter.XSLTConversion contained in the plain J2SE Adapter Engine are also directly available with this module.

Other classes that are made known in XI 2.0 by the enhancement of the Java classpath in the Adapter Engine must be deployed in a special procedure for the Adapter Engine.

Integration

You make the dispatcher specifications in the module processor.

More information: Module Processor

Features

Transferring the Configuration

      Using the Dispatcher: Example shows you an example of how to configure the transform classes com.sap.aii.messaging.adapter.Conversion and com.sap.aii.messaging.adapter.XSLTConversion to be called successively. This configuration is transferred to the module processor.

      In the plain J2SE Adapter Engine, all parameters are preceded by a namespace (in the example namespace1), which describes the actual dispatcher implementation. Two services are defined for this dispatcher. The parameters of these services are identified by another namespace (in the example Plain2XMLService and XSLTService).

In the J2EE Adapter Engine, these two specifications are made when the parameters are transferred in a module configuration and are therefore not part of the parameter names.

Deploying the External Classes for the Module Processor

External Java classes are specified in the same way as the classes used above, using Transform.Class. To enable these Java classes to be loaded from the AF_Modules/MessageTransformBean module, they must first be made known to the corresponding Java libraries (JAR files) of the J2EE application.

This is done in the same way as for the deployment of drivers for the JMS or JDBC adapter, namely by installing the archive file aii_af_jmsproviderlib.sda, which you must modify beforehand.

Use a zip program to add the JAR file to the archive archive aii_af_jmsproviderlib.sda.

      Change the provider.xml file from aii_af_jmsproviderlib.sda.

       Extract provider.xml and add the line <jar-name>thejarname</jar-name> to each JAR in the <jars> area.

       Add the following lines to the <references> area:

<reference type="library" strength="weak">com.sap.aii.messaging.runtime</reference>

       Add the changed provider.xml to the archive.

Make sure that the original path specification server\ is retained. Check the last path specification.

      Add all JARs (without path specification) that you defined in provider.xml to aii_af_jmsproviderlib.sda.

      Use the Software Delivery Manager to deploy aii_af_jmsproviderlib.sda.

       If the empty archive has already been deployed during installation, choose Update deployed SDAs/SCAs that have any version in the first step of the deployment.

       Otherwise, the deployment will be stopped with the message Already been deployed.

Restart the J2EE server. The libraries are now known to the module processor.

Caution

The aii_af_jmsproviderlib.sda archive is used by several components and adapters of the Adapter Engine. Make sure that you do not delete any components from the archive, as this may prevent the JDBC adapter or the JMS adapter from functioning correctly.

Therefore, you must only add the required classes to the last-deployed version of aii_af_jmsproviderlib.sda.

MessageTransformBean Parameters

      You can set the following MIME content fields to describe the payload:

For more information about the fields, see RFC1806, RFC2045, and RFC2378.

Parameter

Value

Transform.ContentDisposition

attachment or inline

For example, attachment;filename=”abc.txt”

Transform.ContentDescription

Description

Transform.ContentType

Specifies the payload type, for example, text/plain.

Transform.PermanentErrors

true or false

You can define whether module errors are to be evaluated as temporary or permanent.

In the sender file/FTP adapter, you can perform an evaluation if error archiving is activated.

More information: Configuring the Sender File/FTP Adapter, under Processing Parameters, Archiving Files with Errors.

      Under parameter name TransformClass, enter the name of the dispatcher class as the parameter for the module.

      Then specify all parameters that are to be passed to the dispatcher class. See below under Example.

If you call MessageTransformBean without specifying a dispatcher class, only the values for the MIME content fields are set.

Example

The following example shows the configuration for the plain J2SE Adapter Engine and the migrated configuration in the module processor.

Parameter Specifications in the Adapter Configuration (Plain J2SE Adapter Engine)

Parameter

Value

namespace1.Service.1

Plain2XMLService

(Plain2XMLService is an arbitrary name)

namespace1.Plain2XMLService.class

com.sap.aii.messaging.adapter.Conversion

namespace1.Plain2XMLService.xml.conversionType

SimplePlain2XML

namespace1.Plain2XMLService.xml.processFieldNames

fromConfiguration

namespace1.Plain2XMLService.xml.fieldNames

a,b,c

namespace1.Plain2XMLService.xml.fieldSeparator

;

namespace1.Plain2XMLService.xml.documentNamespace

<Document Namespace>

namespace1.Plain2XMLService.xml.documentName

<Document Name>

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

Parameter Specifications for the XSLT Conversion in the Adapter Configuration (Plain J2SE Adapter Engine)

Parameter

Value

namespace1.Service.2

XSLTService

(XSLTService is an arbitrary name)

namespace1.XSLTService.class

com.sap.aii.messaging.adapter.XSLTConversion

namespace1.XSLTService.XSLTConversion.XSLTFileName

Data/DemoConversion.xsl

 

These specifications result in the following:

Specifications in the Processing Sequence of the Module Proessor

Nr

Module Name

Type

1

AF_Modules/MessageTransformBean

L

2

AF_Modules/MessageTransformBean

L

3

<Adapter-specific module name>

L

Caution

If you are configuring the module chain explicitly, as is the case here, you must set the last module in the chain as described in Module Processor under Integration.

Specifications in the Module Configuration of the Module Processor

Parameter Name

Parameter Value

Comments

Transform.Class

com.sap.aii.messaging.adapter.Conversion

Parameter for first call of module MessageTransformBean

xml.conversionType

SimplePlain2XML

xml.processFieldNames

fromConfiguration

xml.field.Names

a,b,c

xml.fieldSeparator

;

xml.documentNamespace

<Document Namespace>

xml.documentName

<Document Name>

Transform.Class

com.sap.aii.messaging.adapter.XSLTConversion

Parameter for second call of module MessageTransformBean

XSLTConversion.XSLTFileName

Data/DemoConversion.xsl

Note

The specification of the Java class to be executed is always set for the module with the Transform.Class parameter. This corresponds to the <namespace>.class parameter in the configuration of the plain J2SE Adapter Engine.

You only need to specify the document name and the namespace if the payload of the message is processed in the message mapping.

 

 

 

 

End of Content Area