Skip to Content
0
Feb 24, 2009 at 07:18 AM

Get dynamic filename in a Java Mapping (NOT UDF)

827 Views

Hi,

we are using a Java Mapping step in XI (not UDF). We need to have access to the filename. In the File Adapter we set the message attributes and can see the filename value in the SXMB_MONI.

We use the following code fragment to have access to the filename:

Container container = new Context(new FunctionWrapper(0));

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String sourceFileName = conf.get(key);

This doesn't work. We think the declaration of the container class is wrong. Does anybody have some information about using the dynamic attributes in Java Mappings?

Thanks in advance

Michael