on 03-25-2015 10:51 AM
Hi experts,
I have an scenario in which I pick a zipped file with two files inside, a txt and a pdf file. The two files contained must be placed in two differents folders with their original names. So it's File to File scenario.
I have been reading a lot of blogs and posts in scn but i haven't found any solution for this particular case.
The zip is correcty unzipped in sender file channel and the two payloads (one for the txt and the another one for the pdf) are served for input. The two files are then placed correctly in their corresponding folders with static names using File scheme option in the File receiver.
I have seen in sxmb_moni the payload names, and i don't know how to get it in receiver file channel in order to set the file name with payload name.
filename ASMA attribute gets the name of the zipped file in sender file channel so it doesn't work for me. I want to avoid ESR objects, so UDF/java mapping is my last option.
Any ideas?
Thanks in advance.
Hi, finally solved using Java Mapping.
Thanks everybody for the ideas you've posted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi José Miguel,
I think you should use the ASMA configuration and ESR objects, it is the easy way to do it. With variable substitution you would need to have the filename in the payload, and with OS commands or module adapter the scenario will be more complicated to maintain and understand.
You can set two scenario file to file. The first to unzip the files in the receiver side, and the second one to work with the files unzipped.
Hope this helps.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Iñaki,
I need one scenario.
I have the filename in the payload of the xml file, but only works for the receiver file which manage the xml.
The receiver file CC which works with the pdf is not prepared to get the filename from the payload which serves as input, because it's in binary format.
I know with ASMA + UDF/Java Mapping i could achieve this requierement but i wanted to know if exists any posibility with adapter module or some tricky solution with variable substitution.
Thanks.
I don't think it's possible without a java mapping/adapter module. Any reasons to avoid?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jose
In my document that Hareesh referenced above, I've mentioned that if the standard PayloadSwapBean is used, the filename of the first file in the Zip file will no longer be available. That is why a Java mapping is needed if you want to get all the original names in the Zip file.
Also, I don't think you can achieve this with a single scenario using standard functionality if you want to deliver the files to different folders. Unzipping by either PayloadSwapBean or Java mapping will only create additional attachments but still a single message. And you can only send that message to 1 target folder.
I would suggest that you break the scenario into two steps.
Step 1:
Pick up zip file, unzip with Java mapping and deliver all attachments to temporary folder (you will need to use an adapter which supports attachment at receiver channel like SFTP)
Step 2:
Have 2 different channels to pick up txt and pdf files separately and deliver to final separate folders.
Alternatively, if you use the following module, you can have just a single sender channel to pick up both types of file, and use regex mode to determine destination folder - refer scenario 5 of the document.
Rgds
Eng Swee
User | Count |
---|---|
84 | |
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.