cancel
Showing results for 
Search instead for 
Did you mean: 

File adapter configureation

Former Member
0 Kudos

I have a directory that contains two different files. Hierarchy1_mm-dd-yyyy.txt and Hierarchy2_mm-dd-yyyy.txt

Here is my goal:

1. Pick up both files with one sender channel.

2. Drop the files in a new directory as Hierarchy1 and Hierarchy2

Currently I have a sender channel that picks up a .txt file from source directory and a receiver channel that drops the file in a new directory. I do this all through the Integration Directory side. Problem is i have two different files and am only creating one file in my target directory. I need to pick up two files from the source and drop two files in the target. I realize i can do this buy creating two sender channels and two receiver channels but that requires me to create two of everything else as well. I would like to do this with one sender and receiver channel.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Derrick,

If you can use *.txt in sender CC, then you can do the following.

In Sender channel, check Adapter Specific Message Attribute "File Name"

In Receier communication channel in file name scheme put %File_Name%

Then you will be having same file name in receiver directory as you have in sender directory.

Regards,

Venu

Former Member
0 Kudos

Only one thing. In my target directory the file has to be placed without the date stamp. So as the source file is

Hierarchy1_mm-dd-yy.txt in the target directory it needs to be just Hierarchy1. Can I use the same scenario you gave me but rename the two files that are sent to not have the date stamp?

Former Member
0 Kudos

Hi

> Only one thing. In my target directory the file has to be placed without the date stamp. So as the source file is

> Hierarchy1_mm-dd-yy.txt in the target directory it needs to be just Hierarchy1.

For this you can use the dynamic configuration code

https://wiki.sdn.sap.com/wiki/display/XI/Combining%20three%20different%20aspects%20of%20PI%20in%20on...

Based on your requirement you can change the code like below, and map this UDF to the Top most root node.

DynamicConfiguration conf=(DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key=DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String targetFileName="Hierarchy1.txt";

conf.put(key,targetFileName);

return "";

Regards

Ramesh