Skip to Content
Aug 05, 2017 at 08:54 AM

dynamic file name and content conversion for receiver mail adapter


Hi All,

My requirement is From,To, Filename from xml message which is coming as proxy. so at receiver side i have used mail package. below is the mapping i performed.

for the content field i have mapped like below

below are the parameters for the channel

for the receiver root mail node i have used below UDF to generate the file name dynamically. but when the mail comes to my inbox it is showing FileName as MainDocument.txt. once i opened the attachment then only i can see my file mapping level i have not mapped for type,description,disposition. please suggest what corrections i have to make?

MappingTrace objTrace = container.getTrace();
DynamicConfiguration objDynConfig;
DynamicConfigurationKey objDCKey;
final String NAMESPACE ="";
final String ATTRIBUTE3 ="XHeaderName3"; //ContentDisposition
final String ATTRIBUTE1 ="XHeaderName1";//ContentType
final String ATTRIBUTE2 ="XHeaderName2"; //ContentDescription
String strFileName ="";
objDynConfig = (DynamicConfiguration) container.getTransformationParameters().
get(StreamTransformationConstants.DYNAMIC_CONFIGURATION );
objDCKey = DynamicConfigurationKey.create(NAMESPACE, ATTRIBUTE3);
strFileName="attachment; filename=" + strFileName;
objDynConfig.put(objDCKey, strFileName);
strFileName= "text/plain;";
objDCKey = DynamicConfigurationKey.create(NAMESPACE, ATTRIBUTE1);
objDynConfig.put(objDCKey,  strFileName);
strFileName = Prefix;
objDCKey = DynamicConfigurationKey.create(NAMESPACE, ATTRIBUTE2);
objDynConfig.put(objDCKey, strFileName);

container.setParameter(StreamTransformationConstants.DYNAMIC_CONFIGURATION, objDynConfig);

catch (Exception objException)


                objTrace.addWarning( objException.getMessage() );


return "";


capture1.png (2.5 kB)
capture2.png (29.0 kB)
capture2.png (29.0 kB)
capture3.png (7.6 kB)