cancel
Showing results for 
Search instead for 
Did you mean: 

Sender file adapter module: Get flat payload BEFORE content conversion

Former Member
0 Kudos

Hi,

as we get huge input files for a file to Idoc interface, I am currently creating an adapter module to split the file into chunks in the sender file adapter.

The input file is CSV with dependiencies between the lines, that is the reason why we can not use the standard splitting mechanism in the file adapter.

I created a module now and inserted it into the chain:

Now I try to get the flat (not XML) payload in the adapter code but it does not work. If the whole XML payload is created before the module is called, the module will not work as I want it to do. I tried this, but always get the xml document:

The idea was the following:

  1. Read N lines of input file
  2. Give them to next adapter module (I thought this would be the time when content conversion to xml takes place)
  3. Wait a time
  4. Repeat until file is processed completely

Please help. Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

engswee
Active Contributor
0 Kudos

Hi Stefan

I think that if you use the Content Conversion of the File adapter, it actually takes place before any module in the module chain is executed. That is why you get the XML when executing your module, even though it is the first one in the chain.

To achieve your requirement, I would suggest that you NOT use the Content Conversion, but to use the MessageTransformBean to achieve FCC instead.

Then your module chain would look something like that:-

1) SplitFileModule

2) MessageTransformBean

3) CallSapAdapter

Rgds

Eng Swee

Former Member
0 Kudos

Hi,

that was right! I was able to get the flat payload following your suggestion.

But I have another problem: The process method can return data just one time. I would need something like a loop doing the following:

Read N lines e.g. 500

Pass them to content conversion

Repeat

This seems not to be possible. I think the adapter module is called for one file just one time, right? Is there any possibility to pass "chunks" of the data to the next processing step?

I read here that this is not possible bu found no further information:

engswee
Active Contributor
0 Kudos

Hi Stefan

Yes, the module is only executed once. Once it is completed, then message processing moves to the next module in the chain. I don't think it's possible for one module to pass data into the next module and still be in a waiting state.

Regarding creating child messages, I am not familiar how to achieve this in an adapter module. I've looked through the JavaDocs for the adapter framework and can't find any such methods. However, I do know that Seeburger's BIC module bean has the capability to split a message into multiple child messages and send those messages back into the Inegration engine via a Split997 channel. Unfortunately I do not have access a system with Seeburger now to use the following technique to get and study the BIC module bean source code.

Maybe there are other alternatives to achieving your requirement, i.e. multi-mapping, Java mapping, BPM, etc. Can you elaborate the reasoning behind splitting the file every N lines? Also, after the split has been completed on the sender side, does it need to be recombined at the receiver side? Will the file adapter's chunk mode fulfill your requirement?

Rgds

Eng Swee