on 10-28-2008 12:50 PM
Hi ,
I am using UDF for creating dynamic file name.
My requirement is
i have to create n file for n context of a field A
queue= context
String headerField="";
java.util.Map map;
map = container.getTransformationParameters();
for(int i= 0;i<a.length;i++)
{
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
String s3 = "http:/" + "/sap.com/xi/XI/System/File";
DynamicConfigurationKey key1 = DynamicConfigurationKey.create(s3,"FileName");
String newFileName = a<i>.concat(".txt");
headerField = conf.put(key1,newFileName);
result.addValue(headerField);
}
suppose
A has 3 conetex
UK
US
DK
then 3 files should be created with names
UK.txt,US.txt and DK.txt
but unfortunately
only 1 file is creating that is UK.txt
can anyone tell me is possible to create 3 files...
Hi,
Confirm that your scenario is creating 3 file by executing it without Dynamic Filenaming.
If the configuration is correct then try the Variable Substution rather than using the UDF.
My speculation is that since the mapping happens for all the three files first, when the adapter is creting 3 files it can access only a filename. The 3 files are created with the same name overwritting each other and finally you see only one file. May be you can confirm my speculation by selecting the Mode as Append thus you see a single file with all the 3 file contents. Test this and let us know.
Thanks
SaNv...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you could check if your target field is unbounded and use a splitByValue after your UDF.
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi patric,
thanks for ur reply...but i have checked..with that also
my target node is unbounded and i use splitByValue(each value)
still its creating a single file...
to give u more info abt my scenario...
i am using multi mapping...
source message occurence 1
target message occurence 1..unbounded
so depending upon the content of field A message will be created..
according to the example i have given....
it should created 3 message and thus 3 different file.
please have a look @ my previous thread....
>>yes santhosh,
>>u r correct !!!
Ohh.. Good.. So my speculation is the fact.. May be this should be documented that Dynamic File naming using UDF can't be done for multiple file scenario.
>>i cant use variable sub.. since target structure input value not coming...
From your file extension .txt I assume that you are using contenten conversion..
So you can add a addition node to hold the filename, use it in the variable substution and remove it using the content conversion in the receiver adapter....
Thanks
SaNv...
Hi Santosh,
R u sure enough that we it cant be done usin UDF....???
and r u sure its possible using var sub???
if yes please help me
my target structure has more than 50 field....
suppose i add one field in my target structure..(suppose 1 st field)
what FCC parameter i have to use to exclude this field.. please tell
>>R u sure enough that we it cant be done using UDF....???
I Believe it can't be....
>>and r u sure its possible using var sub???
Yes.. it can be since you are going to have a same root structure...
>>what FCC parameter i have to use to exclude this field.. please tell
Assuming that your root node is MT_TRG add a element filename to it.
Use the following in the Variable substution.
payload:MT_TRG,1,filename,1
Use this in the FCC to remove the filename
filename.fieldFixedLengths = 0
filename.fixedLengthTooShortHandling = Cut
filename.endSeparator = '0'
Thanks
SaNv...
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.