cancel
Showing results for 
Search instead for 
Did you mean: 

Payload name as filename issue

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi, finally solved using Java Mapping.

Thanks everybody for the ideas you've posted.

iaki_vila
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

iaki_vila
Active Contributor
0 Kudos

Hi José Miguel,

Have you thought to use ASMA inside an own module adapter?: , you will skip ESR development although you will need to use java development.

Regards.

Former Member
0 Kudos

Hi again,

Have no intention to deploy an own module adapter but it's a good solution for the future.

Thanks again!

former_member184720
Active Contributor
0 Kudos

I don't think it's possible without a java mapping/adapter module. Any reasons to avoid?

Former Member
0 Kudos

Hi Hareesh,

With adapter module is possible? How can i get the payload name in order to set this attribute as file name?

Did you mean that?

Thanks.

former_member184720
Active Contributor
0 Kudos

You can unzip and retain the file names..  it should be possible with AM too(if you don't unzip in sender channel)

Former Member
0 Kudos

I unzip at File sender channel, and also this solution requires some coding.

Thank you.

engswee
Active Contributor
0 Kudos

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