In modern integration scenarios, data routing and manipulation are essential for enabling efficient communication between systems. Within SAP Cloud Platform Integration (CPI), Filters and Splitters are two powerful pattern-based tools that help manage complex message processing.
This article explores how Filters and Splitters function, their use cases, and how to work with them effectively within the CPI environment.
A Filter in CPI allows you to conditionally route or process messages based on their content or headers. It acts like a gatekeeper, ensuring that only messages meeting certain criteria pass through to the next processing step.
Use Case Example:
In an iFlow, you may receive customer records from multiple regions. You can use a filter to forward only records from Europe to a specific downstream system.
A Splitter breaks a single incoming message into multiple smaller messages. This is particularly useful when dealing with batch messages (e.g., a payload with multiple records), where each record must be processed individually.
Use Case Example:
You receive a purchase order containing multiple line items. A splitter can separate each line item so that they can be processed or routed independently.
Drag a Filter step from the pallet into your integration flow.
Configure the condition:
/Customer/Country = 'DE'Only messages meeting the condition will proceed beyond the filter step.
Insert a Splitter step where you want to break the message.
Select the splitting type (General or Iterating).
Define the split expression:
/PurchaseOrder/Items/ItemProcess each split message in the subsequent steps (mapping, transformation, etc.).
Scenario: A logistics company receives an XML file with shipping orders for multiple destinations.
Filters and Splitters are essential components of the SAP Cloud Platform Integration toolkit. They provide granular control over message processing, making it easier to implement flexible, scalable, and efficient integration flows.
By mastering Filters and Splitters, integration developers can ensure that data flows through the appropriate paths and processes — enabling smarter automation, better performance, and seamless system interoperability within the SAP landscape.