on 03-15-2010 5:03 PM
Hi Guys,
I need to dynamically post the file into different directories based on the file in the source payload.
In Receiver File Communication Channel
Target Directory : *
Filename : *
Checked the ASMA Attributes for filename and directory
Iam refering this weblog
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
In the mapping
<filename> ---> UDF --> topnode of target message.
My UDF is as below
public String Directory(String a,Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
String FileName = conf.get(key);
FileName = a;
conf.put(key, FileName);
String Directory = conf.get(key1);
Directory = "/SAPInterface/XI/PPD/DHX/out";
conf.put(key1, Directory);
return " ";
}
But in runtime(moni) iam getting error as
com.sap.aii.af.ra.ms.api.MessagingException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
Please suggest me how to correct this.
Thanks
Srinivas
Hi,
do you see dynamic configuration nodes in the target XI message header ?
(if not maybe the UDF does not get executed)
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Michel,
missed the configuration in ID
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> But in runtime(moni) iam getting error as
> com.sap.aii.af.ra.ms.api.MessagingException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
You are getting this error message because you have not selected the ASMA settings in your Sender File Adapter. Just select the ASMA setting along with FileNmae & DirectoryName and then test your scenario again.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apart Michael's suggestion, the following statements are not required.
String FileName = conf.get(key);
FileName = a;
String Directory = conf.get(key1);
Directory = "/SAPInterface/XI/PPD/DHX/out";
Instead use,
conf.put(key, a);
conf.put(key1, "/SAPInterface/XI/PPD/DHX/out");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
You said you are having dynamic directories to post the file. But I see you hardcorded or put constant for directory which is /SAPInterface/XI/PPD/DHX/out. I think you need to put //SAPInterface/XI/PPD/DHX/out.
Try this in udf:
public String Directory(String a,Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
String FileName = conf.get(key);
FileName = a;
conf.put(key, FileName);
Directory = "//SAPInterface/XI/PPD/DHX/out";
conf.put(key1, Directory);
return " ";
}
Put FileName and Directory in file name and directory paramters in receiver communication cahnnel and cehck.
Regards,
--Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.