cancel
Showing results for 
Search instead for 
Did you mean: 

Hana Cloud integration - Split file by no of rows

Former Member
0 Kudos

Hi,

we have an integration requirement to push data from System A(XML) to System B (pipe de-limited file), we planned to use HCI to transform System A content as required by system B. few requirement from System B as below,

  • 1.system B can accept the file with only 1000 rows, System A pushes huge data but needs to be split in to 1000 rows per file (pipe de-limited file).
  • 2.For example, if System A send 10 orders. While splitting order data in to pipe de-limited file with constrain of 1000 rows, then file writing process should check whether the 1000 th row is reached if so then it should check also if records for a particular order are only partially processed if so then skip the file and move on to next file and write the complete order data.

Can we use reiterate splitter and ftp adapter to complete this logic or need any hand coding using groovy or java script?

Regards,

Ganesh

Accepted Solutions (0)

Answers (1)

Answers (1)

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Ganesh,

You can use the Splitter to generate 1000 rows per file ,by unchecking Parallel Multicast you can guarantee splitted messages are sent one by one in the order it was split.

Since File or SFTP channel at receiver side is asynchronous in nature,you will not be able to decide whether all the orders sent in a batch is successfully processed or not.From my understanding perspective #1 can be achieved but #2 is not possible with SFTP adapter.

Regards,

Sriprasad Shivaram Bhat

Former Member
0 Kudos

Thanks for answering #1. do you think groovy scripting helps to achieve #2.

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Ganesh,

As per my understanding its not possible since SFTP channel will not give you any response [ Asynchronous Communication ] about the record processing status from System B.

Regards,

Sriprasad Shivaram Bhat

Former Member
0 Kudos

Thanks for the reply, probably little more clarification on #2, let's say System A pushes 100 orders and those orders needs to be split by 10 orders per file (based on system B limitation). While splitting, the order data should not split, each of the split file should contain full order information for processing. after split the HCI process has to use sFTP adapter to push files to System B, ordering of the files is not a big concern until split files has contain full order information.

Do you think we can achieve the file split by groovy script to push files to System B (where ordering is not a concern when the individual files contain full order information for processing).

Regards,

Ganesh

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Ganesh,

Its possible using General Splitter Only.May be below might help you( I am considering for splitting the record or file to have 2 Orders )

Input XML:

<Orders>
    <Order>
        <OrderNo>001</OrderNo>
        <OrderDetails>Test Order1</OrderDetails>
    </Order>
    <Order>
        <OrderNo>002</OrderNo>
        <OrderDetails>Test Order2</OrderDetails>
    </Order>
    <Order>
        <OrderNo>003</OrderNo>
        <OrderDetails>Test Order3</OrderDetails>
    </Order>
    <Order>
        <OrderNo>004</OrderNo>
        <OrderDetails>Test Order4</OrderDetails>
    </Order>
    <Order>
        <OrderNo>005</OrderNo>
        <OrderDetails>Test Order5</OrderDetails>
    </Order>
</Orders>

Splitter Configuration:

Output XML:

XML1:

<Orders>
    <Order>
        <OrderNo>001</OrderNo>
        <OrderDetails>Test Order1</OrderDetails>
    </Order>
    <Order>
        <OrderNo>002</OrderNo>
        <OrderDetails>Test Order2</OrderDetails>
    </Order>
</Orders>

XML2:

<Orders>
    <Order>
        <OrderNo>003</OrderNo>
        <OrderDetails>Test Order3</OrderDetails>
    </Order>
    <Order>
        <OrderNo>004</OrderNo>
        <OrderDetails>Test Order4</OrderDetails>
    </Order>
</Orders>

Regards,

Sriprasad Shivaram Bhat

Former Member
0 Kudos

Thanks alot for the response and it helped.

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Ganesh,

Good to know it helped.Please close the thread.

Regards,

Sriprasad Shivaram Bhat