Skip to Content
0

Hana Cloud integration - Split file by no of rows

Apr 13, 2017 at 09:28 PM

120

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sriprasad Shivaram Bhat Apr 14, 2017 at 07:13 AM
0

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

Show 6 Share
10 |10000 characters needed characters left characters exceeded

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

0

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

0
Sriprasad Shivaram Bhat

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

0

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

0

Thanks alot for the response and it helped.

0

Hello Ganesh,

Good to know it helped.Please close the thread.

Regards,

Sriprasad Shivaram Bhat

0