Skip to Content

Hello Integrators!

 

In this blog, we shall look into the splitter pattern provided in SAP Cloud Platform Integration. The use of a splitter is quite clear from its name – to break out a composite message into a series of individual messages, each containing data related to one item.

 

How is Splitter supported in Integration Flows?

 

In SAP Cloud Platform Integration, a splitter is available as a Message Routing flowstep. When you configure a splitter flowstep, it can appear confusing at first. Lots of options!

 

Splitter_Options.JPG

 

Nevertheless, let us try to understand Iterating and General Splitter first.

A very cool way to understand the workings of the splitter is by configuring a integration flow like below (idea courtesy: HCI development team).

Integration_Flow.JPG

In the Content Modifier step, I insert the following payload in the Body. It is group of orders:

Orders_full.JPG

Each order has details in the following format.

Order_expanded.JPG

 

Now, let us see how the splitter works. In the first splitter, after the content modifier, we have configured a General splitter the following properties.

SP1.png

 

/wp-content/uploads/2015/01/output1_625826.png

 

The exclusive gateway step routes the message according to the ordernumber.

gateway.JPG

 

Let us go to the second splitter that has been configured as a Iterating splitter with expression type as Token.

/wp-content/uploads/2015/01/config_2_625829.png

This is how the output of the second splitter looks like. Notice that the root tags of the incoming payload is not retained and further, it has been grouped as per the number provided.

 

/wp-content/uploads/2015/01/output2_625830.png

Note: The Token splitter is mainly used for non-xml payload. I have just illustrated this example so that you can understand its working. Here “<item>” (including the angle brackets) form the “token”.

 

And if we configure the Iterating splitter with the expression type as XPath and the properties as below, we get the same output as the previous one. The only difference being there shall be the XML tag in the beginning of the output message <?xml version=”1.0″ encoding=”UTF-8″?>.

SP_3.JPG

 

The forth splitter is also a General splitter. But, I recommend that you configure the same so that you can see the difference with the Iterating splitter against the same message. The difference lies in the enveloping signature of the XML. Compare this output with the previous one.

GeneralSplitterOutput.JPG

 

Conclusion

 

You use the splitter flow step in SAP Cloud Platform Integration to break down a composite message. For XML payloads, you would use the general and iterative-xpath splitters. Iterative-token type is used for non-xml payloads. The other variants – IDOC and PKCS are used in specific scenarios. I shall cover those in another blog.

 

Best Regards,

Sujit

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Misher Liu

    Hi Sujit, These series of blogs about dev in HCI are very very very useful. I am your big fan. Thanks a lot for sharing. Br Misher

    (0) 
  2. Arpna Kaul

    Hi Sujit,

    I have a similar requirement like you showed. In the end, instead of generating separate output documents I want to combine in a single document. It is like I am executing in a loop i.e. one employee at a time based on their employee status and then I want to send a single document in the end. As employees are being executed 1 at a time therefore n number of documents are being created currently.

    What I understand is that we cannot use Gather after router so please help me with best possible solution.

     

    Thanks,

    Arpna

    (1) 
  3. Poornapragna TS

    Hi Sujit,

     

    When we use Iterating splitter, do we get to know the index of the item that we are iterating currently in the flow?

    Is there any index variable set by HCI so that we can use it?

     

    Thanks & Regards,

    Poornapragna

    (0) 

Leave a Reply