Show TOC

Inserting MessageTransformBean in Module ProcessorLocate this document in the navigation structure

Use

The AF_Modules/MessageTransformBean module is shipped with the module processor. You use this module to call classes written for the Adapter Engine (SE).

You can set MIME content fields and configure the dispatcher using the module MessageTransformBean that is compatible to the dispatcher and which is contained in the Adapter Engine (SE). With this module you can directly call the classes in the module processor which were written for the Adapter Engine (SE).

For specific adapters in the Adapter Engine (SE) you have the option of modifying the payload of a XI message by using external Java classes. The Java classes must have implemented the Transform Java interface for this.

The classes com.sap.aii.af.sdk.xi.adapter.Conversion and com.sap.aii.af.sdk.xi.adapter.XSLTConversion contained in the Adapter Engine (SE) are available directly.

You must deploy all other classes that in XI 2.0 were made available by means of an enhancement to the Java classpath in the Adapter Engine for the Adapter Engine (SE) by following a special procedure.

More information: Inserting Modules in the Module Processor , Example of How to Use the Dispatcher

Prerequisites

In the Adapter Engine (SE), each parameter is proceeded by a namespace (namespace1 in the example), which describes the actual implementation of the dispatcher. Two services are defined for this dispatcher, and the parameters of each service are in turn identified by a further namespace (Plain2XMLService und XSLTService in the example).

Since the parameters have been transferred in a module configuration, the Adapter Engine already has this information and consequently the information is not included in the parameter names.

Procedure

Deploy External Classes for the Module Processor

  1. You specify external Java classes by using Transform.Class as in the classes above.

    To load such Java classes from the AF_Modules/MessageTransformBean module, you must make them known to the relevant Java libraries (jar files) in the AS Java application.

    To do so, install and modify the com.sap.aii.adapter.lib.sda archive file:

    • Add the jar file to the archive com.sap.aii.adapter.lib.sdaarchive by using a zip program.
    • Change the provider.xml file from com.sap.aii.adapter.lib.sda.
      • Extract provider.xml and add <jar-name>thejarname</jar-name> to each jar in the <jars> area.
      • Enter the following line in the <references> area:

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

      • Add the changed provider.xml to the archive again.
      • Ensure that the original path server\ is not changed. Check the last path entry.
  2. Add all the jars (without specifying their path) that you defined in provider.xml to com.sap.aii.adapter.lib.sda.
  3. Use the Software Delivery Manager to deploy com.sap.aii.adapter.lib.sda.
    • If the empty archive was already deployed during installation, in the first step in deployment choose Update Deployed SDAs/SCAs that Have any Version.

      Otherwise deployment will terminate with the following message: Already been deployed.

  4. Start AS Java again.

    The module processor now knows the libraries.

    Caution

    The com.sap.aii.adapter.lib.sda archive is used by multiple components and Adapter Engine adapters.

    Ensure that you do not delete any components from the archive otherwise the JDBC and JMS adapters may cease to function correctly.

    Consequently, always add the classes you require to the last deployed version of com.sap.aii.adapter.lib.sda only.

Set MIME Content Fields

  1. You can set the following MIME content fields under Parameter Name to describe the payload.

    More information about the fields available in RFC1806, RFC2045 and RFC2378.

    • Transform.ContentDisposition

      Under Parameter Value enter attachment or inline.

      Example: attachment;filename="abc.txt"

    • Transform.ContentDescription

      Enter the description under Parameter Value.

    • Transform.ContentType

      Enter the payload type under Parameter Value.

      Example: text/plain

    • Transform.PermanentErrors

      Under Parameter Value enter either true or false.

      This defines whether module errors are evaluated as permanent or temporary.

      In the File/FTP adapter, an evaluation can be made if error archiving is activated.

      More information: Configure Sender File Adapter , Configure Sender FTP Adapter , Processing Parameters, Archive Source Files with Errors.

Specify Parameters for the Dispatcher Class

  1. Under Parameter Name TransformClass, enter the name of the dispatcher class as the parameter for the module.
  2. Enter all the parameters that are to be passed to the dispatcher class.

    More information see below under Example.

Result

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

Example

The example shows the configuration for the Adapter Engine (SE) and the migrated configuration in the module processor.

Adapter Configuration for the Adapter-Engine (SE)

  • namespace1.Service.1

    Value: Plain2XMLService (Plain2XMLService is a user-defined name)

  • namespace1.Plain2XMLService.class

    Value: com.sap.aii.af.sdk.xi.adapter.Conversion

  • namespace1.Plain2XMLService.xml.conversionType

    Value: SimplePlain2XML

  • namespace1.Plain2XMLService.xml.processFieldNames

    Value: fromConfiguration

  • namespace1.Plain2XMLService.xml.fieldNames

    Value: a,b,c

  • namespace1.Plain2XMLService.xml.fieldSeparator

    Value: ;

  • namespace1.Plain2XMLService.xml.documentNamespace

    Value: <Document-Namespace>

  • namespace1.Plain2XMLService.xml.documentName

    Value: <DocumentName>

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

XSLT Conversion in Adapter Configuration for the Adapter-Engine (SE)

  • namespace1.Service.2

    Value: XSLTService (XSLTService is a user-defined name)

  • namespace1.Plain2XMLService.class

    Value: com.sap.aii.af.sdk.xi.adapter.XSLTConversion

  • namespace1.XSLTService.XSLTConversion.XSLTFileName

    Value: Data/DemoConversion.xsl

Processing Sequence for Module Processor

  1. AF_Modules/MessageTransformBean
  2. AF_Modules/MessageTransformBean
  3. <Adapter-Specific Module Name>

    All modules are of type Type L.

    Caution

    If, like here, you configure the module chain explicitly, you must set the last module in this chain adapter-specifically.

    More information: Extending the Module Chain for SAP Adapters in the Module Processor

Module Configuration for Module Processor

Which Java class is to be executed is always set for the module by using the Transform.Class parameter. This corresponds to the <namespace>.class parameter in the configuration of the Adapter Engine (SE).

Specification of the document name and namespace is only mandatory if the payload of the message is processed in message mapping.

  • Parameter for the first call of the MessageTransformBean module
    • Transform.Class

      Value: com.sap.aii.af.sdk.xi.adapter.Conversion

    • xml.conversionType

      Value: SimplePlain2XML

    • xml.processFieldNames

      Value: fromConfiguration

    • xml.field.Names

      Value: a,b,c

    • xml.fieldSeparator

      Value: ;

    • xml.documentNamespace

      Value: <Document-Namespace>

    • xml.documentName

      Value: <DocumentName>

  • Parameter for the second call of the MessageTransformBean module
    • Transform.Class

      Value: com.sap.aii.af.sdk.xi.adapter.XSLTConversion

    • XSLTConversion.XSLTFileName

      Value: Data/DemoConversion.xsl