cancel
Showing results for 
Search instead for 
Did you mean: 

How to define file schema for File Receiver Channel?

Former Member
0 Kudos

The source file name (AAAA.BBBB.D1234.T1234) need to be renamed to SourceFileName.zip (AAAA.BBBB.D1234.T1234.zip).  What would be file schema for this in the receiver channel.  I tried various combinations but still not working.  I would appreciate any help.  Thank you in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, the simplest way is through ASMA using an UDF. Write an UDF to get source file name and modify it as per your need, later assign this modified file name to receiver file name using dynamic configuration,

check below blogs -

Dynamic file name and directory in Receiver File Adapter - summary of possibilities - Process Integr...

Combining three different aspects of PI in one shot - Process Integration - SCN Wiki

Regards,

Amol

Former Member
0 Kudos

Amol,

Thanks for the reply.  However, this interface doesn't have any mapping.  It is just pass-through FTP text file.  I just need to re-name as described in my initial blog.

Former Member
0 Kudos

Hi Lee, It's still doable. Check the second link I provided before. Using that you can acheive it for pass through scenario as well. Instead of step 1 (UDF) use ASMA checkbox in sender channel to retain the file name.

Combining three different aspects of PI in one shot - Process Integration - SCN Wiki

Former Member
0 Kudos

Hi Amol,

Have you implemented this example w/o UDF?  I am still getting errors (PI is throwing error "can't resolve the FileName variable...").  Below is my configuration per link.  Please point out what I need to correct.  Thanks!!

Former Member
0 Kudos

Yes, that's always my to go solution for such requirements.

Here is what you need to do -

1) What parameters you have put in for module "AF_Modules/DynamicConfigurationBean" ?, it should be same as what is there in step 2 of the wiki.

2) I see in variable substitution you have used a wrong reference value %f, it should be same as in step 3 of the wiki. (you may use FileName instead of order_no)

3) Don't check ASMA in receiver channel the reason is if you check ASMA in receuver channel the interface will apply source file name as it is to the receiver file name. Thus, leave it uncheck as also mentioned in the wiki.

If you follow the 2) and 3) step of the wiki as it is it should work for you, let me know otherwise.

- Amol

Former Member
0 Kudos

Amol,

I updated to exactly the way the wiki is showing but still getting same error.  This time error is "variable order_no can't be resolved" since I changed the FileNmae to order_no but essentially same error.  Please let me know how this is working for you.  Thanks!

Muniyappan
Active Contributor
0 Kudos

you have used . instead of : for reference.

it should be message:interface_name

Former Member
0 Kudos

Amol must mis-understood my requirement.  The suggested solution produce receiver file name as InterfaceName.zip, not the SourceFileName.zip.  Correcting to : (from . ), message processes but file name is Interface Name with .zip, not the Source File Name with .zip. 

Former Member
0 Kudos

No Lee, The solution will work for filename.

What parameters did you put in adapter module. If you have provided the FileName there then it should work, Also ensure that sender file channel has ASMA checked for filename.

Can you attach screenshot of module section and also your sender comm. channel ASMA

Muniyappan
Active Contributor
0 Kudos

for your requirement please check this thread.

Former Member
0 Kudos

Amol,

Here are the screen shots.  As I wrote previously, system produces the file name as InterfaceName.zip, not SourceFileName.zip.  Isn't below configuration indicates InterfaceName as file name?  Where in this configuration says to create file name with source file name?  What need to be changed to get the Target FileName as SourceFileName.zip.  All I need to do is add .zip to the SourceFileName.  Thanks.

Former Member
0 Kudos

Muni,

Your link suggest that only way to meet my requirement is to create adapter module which I am trying to avoid.  I will wait for Amol's response.  Thanks for the link though..

Former Member
0 Kudos

Ok, I noticed your module parameters has a wrong value, It should be 'value.0'

Former Member
0 Kudos

Amol,

Your suggested solution produces the file name as InterfaceName.zip, not SourceFileName.zip even after correcting 0 vs. o (same result as previous correction).

It's far from the solution that I am looking for.

Former Member
0 Kudos

Dont know why it's not working for you, You are getting interface name as your filename which looks to me that your interface name is not getting overwritten by source filename (this should have been taken care by module AF_Modules/DynamicConfigurationBean). Check in your rcvr channel logs entry do you see this module is being called there

Former Member
0 Kudos

Amol,

Module name is being called for sure.  How else system would generate file name as InterfaceName.zip?  You can set an example interface yourself and I am certain that you will get same incorrect result as mine.

Former Member
0 Kudos

Nope, As i said this solution has always work for me.

Former Member
0 Kudos

Hi Lee,

I guess you can achieve your requirement by using shell script to rename the file.

configure your sender and receiver CC to create filename same as source file name. And create the shell script to rename the file with same source filename with extension ".zip" (sourcefilename.zip), call that script in Run operating system command after message processing in Receiver CC.

Regards,

Praveen

Former Member
0 Kudos

Praveen,

Sorry for the late reply.  Yes, I had to create Unix script to rename the file after realizing that what Amol suggested is not working.  I have created unix script and calling the script in comm channel about 4 years ago in another project.  I was trying to avoid creating Unix script but that's what I end up doing.