cancel
Showing results for 
Search instead for 
Did you mean: 

File sender channel - file name "null"

Former Member
0 Kudos

Hi all,

I am designing a scenario where I am reading 2 files from 2 different senders, and these 2 messages are fed to a multi mapping in BPM, which creates a single target message. I need to read the name of only one of the two source files and populate it in one field of the target message.

I have read some blogs and forum threads about how to access the file name from the sender file channel. It calls for turning on the adapter specifc parameters in the channel and writing the following UDF (taken from Michal's blog #2664) -

-


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

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

String ourSourceFileName = conf.get(key);

return ourSourceFileName;

-


After doing all this, I am getting file name as "null". Can someone pls let me know the cause for this ? My concern is since I want to read only one file name, so I have updated only that specific file sender channel for adapter specific attributes.

Regards,

Shankar

Accepted Solutions (1)

Accepted Solutions (1)

justin_santhanam
Active Contributor
0 Kudos

Shankar,

I'm not sure, but will give a try. Can u set ASMA for both the sender channels?

raj.

Former Member
0 Kudos

Hi Raj,

I checked the ASMA for second channel also, but no luck

I can see both the files names in their respective messages in SXMB_MONI under node 'Dynamic Configuration'. But the two messages enter the multi-mapping within BPM (where I have put trace to print the file name as per above code), the value is shown as "null".

1) Is this file name access is possible only in simple scenarios ?

2) Also, is the file receiver mandatory ? I have email receiver in my scenario.

Any clues ?

Regards,

Shankar

justin_santhanam
Active Contributor
0 Kudos

Hi,

1) Is this file name access is possible only in simple scenarios ?

No. We can use in BPM also. But I read from other threads that some of the parameters were not accessible inside BPM.

2) Also, is the file receiver mandatory ? I have email receiver in my scenario.

No. It's not mandatory. You can have any receiver channels.

Lemme figure it out and give u an update!

raj.

justin_santhanam
Active Contributor
0 Kudos

Shankar,

I created the scenario and checked the same. When we have only one sender then it's possible for me to retrieve the dynamic header informations. If I have two senders as per ur scenario, I'm getting something like Dynamic Configuration not set. I'm not sure it will work. Any how we will wait for expert's suggestions and their solutions.

raj.

Former Member
0 Kudos

Hi Raj,

I have solved the problem. I added one mapping at the source. Earlier the 1st message was being directly sent to BPM. So there was no interface mapping between the outbound interface (which sends the file) and the abstract interface (which receives the 1st message in BPM).

Now I created this interface mapping. So the 1st message passes through the mapping, within which I am retrieving the file name. And hence BPM receives the message which contains the file name.

Thanks for your help..

Regards,

Shankar

justin_santhanam
Active Contributor
0 Kudos

Great! Thanks for letting us know. I think the retrieval is not possible inside BPM if we have multiple sources. Not sure though, need to analyze.

raj.

Answers (0)