Dynamic configuration in adapter modules
Updated 2006-10-11, to reflect comment by Stefan Grube. The original code has been changed to the api described on help.sap.com.
The dynamic configuration is a place where it is possible to store meta-information like filename, mails and other information which is stored by and/or read by an adapter. The information can be used e.g. to map the original filename to the target document or ensure that a file written by the file adapter is given the same name is an input file. The dynamic configuration properties are stored in the XI SOAP header and is therefore available in all pipeline and module steps.
In modules it is sometimes necessary to get access to the dynamic configuration. It could be to add some extra information about the document, which could be used in a mapping, or to get access to a property defined in the mapping or created in an adapter. I’ve used it, for instance, to add an email address, based on a look up performed by the module.
On help.sap.com you’ll find information about how to access dynamic configuration properties in message mappings. It is also described in blogs like Dynamic Configuration of Some Communication Channel Parameters using Message Mapping. This API does not work on adapter modules, however, because the container element is not available in modules. It can, however, be used for setting dynamic information to be used in the module.
I will not get into details about how to create a module; this is described in the “How To Create Modules for the J2EE Adapter Engine” Link.
Here’s a code sample that shows how to get access to the dynamic configuration from within an adapter module:
When the above code is inserted into a module, it has the following result on an XI message:
The sample code can be used both directions.
For more information about the api please look at help.sap.com
Very interesting and useful info.
there are even a few more things you
can do with Z-dynamicconfig from adapter modules
I'll try to show this in my weblog
once I'll find some time 🙂
I've been looking for this type of information for Module Adapter for a while, and your blog was the first source I've found something interesting. 🙂
Could you please provide some information about Javadocs on these classes you use there?
I can't find the import target for the object XIMessage. Can anyone help?
You are not allowed to use undocumented classes like XMBMessageOperator. To get access to dynamic header attributes use the methods setMessageProperty() and getMessageProperty() of the class Message of the adapter module API.
This feature is documented here:
Scroll down for:
Adapter-Specific Message Attributes
This methods are available since SP16.
I have updated the blog, to reflect the new information. It is much more simple than the old version.