Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
alex_bundschuh
Product and Topic Expert
Product and Topic Expert
I would like to share with you another stateful Enterprise Integration Pattern for SAP Cloud Integration, this time the Aggregator pattern. If you like to find out more about the motivation and use cases for the patterns blog series, start with the Enterprise Integration Patterns at SAP Cloud Integration: Scatter-Gather blog. Also, check out the Integration Flow Design Guidelines for SAP Cloud Integration blog referring to integration flow design guidelines and patterns for SAP Cloud Integration that SAP has recently published on the SAP Help Portal.

The Aggregator pattern describes the requirement to collect multiple related messages in order to process them in a bulk. In the following, I will describe how this pattern has been implemented on SAP Process Orchestration, and how you can model it on SAP Cloud Integration.

Aggregator on SAP Process Orchestration


Since the Aggregator pattern keeps a state, Business Process Management (BPM) is required to orchestrate the message flow. For the actual exchange of messages with the involved systems, the Process Integration runtime of SAP Process Orchestration is used. In the following, I focus on the BPM process only. For a detailed description of the overall implementation, please refer to the Enterprise Patterns in Process Orchestration – Aggregator blog.



We like to collect messages within a specific time frame whereas each bulk should have 5 items at most. So, our model is a combination of an intermediate timer event and a loop where we collect the incoming messages meeting the correlation condition. An incoming message triggers the process instance. In the Start event, we reset the counter and store the correlation condition. We use a parallel split gateway to branch into the intermediate timer event path and the path containing the loop. In the loop, we wait for incoming further messages with the same correlation condition like the start event. If a message arrives, we append the respective data object and increment the counter. Depending on what happens first, so either the maximum number of messages or the waiting time has been exceeded, the aggregated message is sent and the process instance is ended. Optionally, you can enhance the model to wait for a dedicated message stopping the collection (not shown here).

Aggregator on SAP Cloud Integration


For a detailed description of the Aggregator pattern on SAP Cloud Integration, please check out the SAP Help Portal. In the following, I will only outline the rough model.



As you can see in the integration flow model, SAP Cloud Integration comes with a dedicated Aggregator flow step. So, you do not need to model the pattern in a loop as seen for SAP Process Orchestration. In the Aggregator flow step, you actually define your correlation condition as well as the completion conditions. Right now, we support last message condition and completion timeout. Unfortunately, maximum number of messages is not supported yet. The rest of the flow steps are used in order to map the collection of items to the right message format, in our case an order with order header information and all items, hence removing redundant information.

On the SAP API Business Hub, you find the Integration Flow Design Guidelines – Enterprise Integration Patterns package. There you can access the Aggregator pattern integration flow to gather more details about its configuration. You can test the pattern either on your SAP Cloud Integration tenant or on the cloud integration runtime of your SAP Process Orchestration 7.5 system.

Hope this helps. Here, a list of the pattern blogs published so far: