on 05-22-2008 12:30 PM
Hi All,
is it possible to set the Filename in File Receiver Adapter from Adapter Module?
I know that it is possible to read the data
Channel ch = new Channel(moduleContext.getChannelID());
path = ch.getValueAsString("file.targetDir");
I Need to set the filename in Adapter Module, using of Payload is not possible because Payload is not xml.
Dynamic Parameters in Message Header is not possible because it is an multi mapping process an i need dynamic Filename for each Part
payload after mapping is like
MainDocument
SubMainDocument
MainDocument
SubMainDocument
i need special Name for each SubMainDocument in FileReceiverAdapter
regards
ralf
using of Payload is not possible because Payload is not xml.
Are u bypassing the IR part. If no, and if the message is in XI, then it will be in xml format
Still, if u want to edit the filename in module then it is possible
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Message is XML in the XI but i have to convert in CSV Format. This will be done by Conversion Agent.
The CMTransformBean is the first Module in the Channel an change the Format.
so the CallSapAdapter Module could not read anything from the payload.
But i dont know how to write the filename!
Edited by: Ralf Zimmerningkat on May 22, 2008 1:54 PM
Thanks for the weblog but i only found code to read the filename
an that is not the problem
Channel channel = new Channel(moduleContext.getChannelID());
Stirng filename = channel.getValueAsString("file.sourceFileName");
i need something like
Channel channel = new Channel(moduleContext.getChannelID());
*channel.setValueAsString*("file.sourceFileName") =filename ;
regards ralf
When you want to set the filename dynamically, you should go for adapter specific parameters:
Message msg = (Message) inputModuleData.getPrincipalData();
msg.setMessageProperty("http://sap.com/xi/XI/System/File", "FileName", fileName);
You have to activate the same in channel.
Check out for blogs about this topic.
Regards
Stefan
Edited by: Stefan Grube on May 22, 2008 3:05 PM
Hi Stefan
afaik adapter specific parameters read the values from message header.
do to multi mapping there is only one header vor different payloads and i need a special filename for each payload.
reading from payload is not possible because the conversion argent change the xml format to csv.
thanks
ralf
Hello Stefan,
interface mapping is an mapping like this:
outbound_interface => Inbound_Interface1
=> Inbound_Interface2
=> Inbound_Interface3
in sxmb_moni this looks like this
Soap_Header
Soap_Body
Payloads
=>MainDocument ( application/xml )
=> SubMainDocument ( text/xml )
=>MainDocument ( application/xml )
=> SubMainDocument ( text/xml )
First SubMainElement is routing to FileReceiverAdapeter A where Filename has to be like "NameA%nr%"
second SubMainElement is routing to FileReceiverAdapeter B where Filename has to be like "NameB%nr%"
%nr% is som value from the Payload.
Payload is not xml because using of Conversion Argent!!
I Think there is only one Dynamic in Header for all subelements, i have test it!
ralf
Sorry, but I Have test it.
if you need informations from mapping in the header and set the informations during mapping with udf like this:
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/File",
"FileName");
conf.put(key, filename);
return filename;
there is only one header information for each mapping also in adapter monitoring
- <SAP:DynamicConfiguration SOAP:mustUnderstand="1">
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">099message4</SAP:Record>
</SAP:DynamicConfiguration>
sorry but i canot upload any pictures
You can put the adapter module before the conversion agent module, then you can access the xml payload.
You started the thread by asking for an adapter module, so I assumed that you can access the data you need in the module.
It is a little difficult for me, to give an advice, when I have to guess, what the customer really wants.
So I would suggest that I describe, what I have done for my scenario to make it work and you can check, if you can do this similar or not.
I did a mapping step, where a introduced a new element for every message, where I put information which I need for the adapter module.
The module reads the information and stores this in the message header. The additional node is deleted by the module.
This workaround is necessary, as the IS does not provide individual headers, but the adapter framework creates them. So the dynamic headers have to be set in the module. dynamic headers put by mapping are ignored.
Hope that helps
Stefan
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.