on 02-28-2011 11:38 AM
Dear All,
We have a requirement from one of our client, where we need to receive file name inside custom adapter module and based on that input file name ,we need to send equalent value mapping file name for that. As we recieve multiple file formats ,hence we have ignored ESR part development, ( created a dummy interface , PI only used as transfer mechanism)
Logic should be inside receiver file adapter to read file name and based on input file name , output file name has to be changed( value mapping, eg: abc-1234.txt has to change as xyz-1234.txt.. like wise) and generate in the output.
Please guide how to acheive this requirement.
Thanks in Advance.
Suman
Hi Suman,
Did you succeed changing filename/directory within adapter module?
I have the same requirement from one of our client.
I tried to use the code: msg.setMessageProperty("http://sap.com/xi/XI/System/File","FileName", fileName);
but nothing append.
Regards,
Gigi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suman,
in my scenarion, i get 2 files from two locations (single Comm Channel). I capture the file name dynamically (dynamic file configuration) as i am getting 2 files and then then use UDF and simple mapping to pass on different constants based on the file name.
Mine is PI 7.0 so in PI7.1 if this can also be achieved, it would be good. check out if this logic would work.
kanan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>> Logic should be inside receiver file adapter to read file name and based on input file name , output file name has to be changed( value mapping, eg: abc-1234.txt has to change as xyz-1234.txt.. like wise) and generate in the output.
Since you dont do ESR objects and mapping, Please follow Stefan's link... might be very helpful..
/people/stefan.grube/blog/2009/06/19/unknown-use-case-of-dynamicconfigurationbean-store-file-name-to-jms-header-without-mapping
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suman,
Check the below Adapter module code:
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
throws ModuleException{
try {
Message msg = (Message) inputModuleData.getPrincipalData();
Payload payload = msg.getDocument();
String fileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File","FileName");
// do something with the filename ( Define the receiver file name)
msg.setMessageProperty("http://sap.com/xi/XI/System/File","FileName", fileName);
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
throw new ModuleException(e);
}
return inputModuleData;
}
Hope this helps you..
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.