SAP CPI Routing Palette Functions: A Precise Guide
The Routing palette in SAP Cloud Platform Integration (CPI) is a critical set of tools for orchestrating
message flow within your integration scenarios. These functions provide the logic to direct,
duplicate, divide, and consolidate messages, enabling complex and efficient business process
automation.
Here's a point-by-point breakdown of the key routing functions:
1. Router:
o Purpose: To direct an incoming message along one specific path out of several
possible routes based on defined conditions. It acts as a conditional "if-else-if-else"
statement for message flow.
o Logic: Conditions are evaluated sequentially. The first condition that evaluates to
true determines the route. If no conditions match, the message takes the mandatory
"Default Route."
o Key Aspect: Ensures that only one branch is executed for a given message, making it
ideal for mutually exclusive processing paths.
2. Multicast:
o Purpose: To send copies of an incoming message to multiple destinations or
branches simultaneously or sequentially. It's a "one-to-many" distribution pattern.
o Types:
▪ Parallel Multicast: All branches receive the message concurrently. This is
efficient for independent operations that don't rely on each other's
completion order.
▪ Sequential Multicast: Branches receive the message one after another in a
defined order. This is useful when the success of one step is a prerequisite
for the next, though often better handled with distinct process steps.
o Key Aspect: Enables parallel processing or multiple independent updates from a
single trigger message.
3. Join:
o Purpose: To synchronize messages that have been fanned out by a Multicast. It acts
as a rendezvous point, ensuring that processing on the main flow waits until all (or a
defined set of) parallel branches from a preceding Multicast have completed their
execution.
o Dependency: Always used in conjunction with a Multicast.
o Key Aspect: It collects the original messages from each path without altering or
combining their content. The primary message entering the Multicast is the one that
exits the Join.
4. Gather:
o Purpose: To combine the content of multiple messages into a single, consolidated
message. This is often used after a Join (which merely synchronizes) to actually
merge the data from different parallel processing paths.
o Aggregation Strategies:
▪ Combine: Concatenates plain text or XML payloads. For XML, it typically
appends the root elements.
▪ Combine at XPath: Merges XML payloads into a new, user-defined XML
structure based on XPath expressions. This provides flexible control over the
resulting XML.
o Key Aspect: Transforms multiple message payloads into one cohesive payload,
essential for downstream systems requiring consolidated data.
5. Splitter:
o Purpose: To break down a single, large composite message into multiple smaller,
individual messages. This is crucial for processing large batches or complex
structures piece by piece.
o Types:
▪ Iterating Splitter: Most commonly used for XML or JSON. It iterates over a
repeating element defined by an XPath or JSONPath expression, creating a
new message for each instance of that element (e.g., splitting an order with
multiple line items into individual line item messages). The original envelope
is typically discarded.
▪ General Splitter: Can split any message type based on a delimiter (e.g., new
line for plain text) or fixed record length. It can also preserve the original
message's header/envelope.
▪ Specialized Splitters: For specific formats like EDI, IDoc, Tar, Zip, etc.
o Key Aspect: Enables individual processing of components within a larger message,
improving error handling and scalability.
6. Aggregator:
o Purpose: To collect multiple related incoming messages (often generated by a
Splitter) over a period of time and then combine them into a single, aggregated
message based on a correlation criterion. It's a "many-to-one" consolidation pattern.
o Core Concepts:
▪ Correlation Expression: Defines how incoming messages are grouped
together (e.g., an Order ID present in each message).
▪ Completion Strategy: Specifies when the aggregation should complete (e.g.,
after a certain number of messages, after a timeout, or when a "last
message" indicator is received).
▪ Aggregation Strategy: How the content of the grouped messages is
combined (e.g., combine XML, combine plain text).
o Key Aspect: Essential for reconstructing a complete business object from fragmented
messages, allowing for batch processing or holistic updates to target systems.
These routing palette functions are the bedrock of complex integration flow design in SAP CPI,
offering precise control over message manipulation and orchestration to meet diverse business
requirements.
SAP CPI Routing Functions – Comparative Table
Function Purpose Input Type Output Type Key Features Common Use
Case
Router Route messages Single One selected Evaluates Country-based
based on conditions message branch sequential routing, order
(if-else logic) conditions; has type-based
default route dispatch
Multicast Send message to Single Multiple Parallel or Notify multiple
multiple branches message branches sequential systems, logging
simultaneously or execution; creates + processing
sequentially message copies
Join Synchronize flows Multiple Single flow Waits for all Wait for parallel
from multiple branches continuation branches to updates to
branches (after complete; no finish before
multicast) payload merging continuing
Gather Merge content from Multiple One Supports Combine
multiple messages messages consolidated Combine and responses from
into a single message message XPath-based multiple
aggregation services
Splitter Split a large message Composite Multiple Iterating or Split order lines,
into smaller sub- message messages general splitter; invoice items
messages supports XML,
JSON, plain text,
etc.
Aggregator Combine related Multiple One Uses correlation Batch
incoming messages related aggregated keys; waits via processing,
over time into one messages message count, timeout, or collect and
last-flag combine
fragments
Quick Comparison Highlights
• One-to-One: Router
• One-to-Many: Multicast, Splitter
• Many-to-One: Gather, Aggregator
• Synchronization: Join (timing only), Gather (timing + content)
Here are interview questions with answers specifically focused on the Routing Palette in SAP CPI,
curated from expert sources like MindMajix, InterviewGIG, and ACTE:
SAP CPI Routing Palette – Interview Questions & Answers
1. What is the Routing Palette in SAP CPI?
Answer:
The Routing Palette contains flow control steps like Router, Splitter, Aggregator, Gather, Join, and
Multicast. These steps help direct, split, merge, and conditionally process messages within an iFlow.
2. What is the purpose of the Router step?
Answer:
The Router directs messages to different branches based on conditions. It supports XPath for XML
payloads and expression language for non-XML formats.
3. What happens if no condition matches in a Router?
Answer:
If no condition matches and a default route is defined, the message follows that path. If not, the
message may be dropped or cause an error.
4. What is the difference between Parallel and Sequential Multicast?
Answer:
• Parallel Multicast: Executes branches concurrently.
• Sequential Multicast: Executes branches one after another and stops if a branch fails.
5. What is the Splitter used for?
Answer:
Splitter breaks a message into smaller parts for individual processing. It’s useful for handling bulk
data like line items in an order.
6. What types of Splitters are available?
Answer:
General Splitter, Iterating Splitter, EDI Splitter, IDOC Splitter, ZIP/TAR Splitter.
7. What is the Aggregator step used for?
Answer:
Aggregator combines multiple messages into one based on a grouping condition. It supports only
XML format.
8. What is the Gather step used for?
Answer:
Gather merges payloads from multiple branches. Unlike Aggregator, it supports XML, plain text, and
mixed formats.
9. What is the Join step used for?
Answer:
Join merges multiple branches into one without modifying the payload. It’s used to unify parallel or
conditional flows.
10. How do you design a Splitter-Aggregator pattern?
Answer:
Use Splitter to divide the message, process each part, and then use Aggregator with a connection
expression and last message condition to merge them.
11. What is the “Last Message Condition” in Aggregator?
Answer:
It defines when the aggregation should complete, typically based on a flag or count in the message.
12. What is the “Connection Expression” in Aggregator?
Answer:
An XPath expression used to group messages for aggregation.
13. Can you use Router inside a Splitter branch?
Answer:
Yes, Router can be used inside Splitter branches to apply conditional logic to each split message.
14. What are best practices for using Router?
Answer:
• Always define a default route.
• Use clear and non-overlapping conditions.
• Log routing decisions for traceability.
15. How do you handle errors in Multicast branches?
Answer:
Use Try-Catch subprocesses in each branch or use Sequential Multicast to stop execution on failure.
Here are more interview questions with answers specifically focused on the Routing Palette in SAP
CPI, curated from expert sources like MindMajix, InterviewGIG, and ACTE:
SAP CPI Routing Palette – Interview Questions & Answers (Extended Set)
16. What is content-based routing in SAP CPI?
Answer:
Content-based routing uses the Router step to direct messages based on payload content. Conditions
can be defined using XPath (for XML) or expression language (for non-XML) to evaluate message
fields and route accordingly.
17. How does the Router step handle multiple matching conditions?
Answer:
If multiple conditions match, only the first matching branch is executed. The Router does not support
parallel execution of multiple branches.
18. What is the role of the default route in Router?
Answer:
The default route acts as a fallback path when none of the defined conditions match. It ensures that
messages are not lost and helps maintain flow continuity.
19. Can you use Router with JSON payloads?
Answer:
Yes. For JSON payloads, use expression language or Groovy scripts to evaluate fields, since XPath is
not natively supported for JSON.
20. What is the difference between Aggregator and Gather?
Answer:
• Aggregator: Groups and merges messages based on a connection expression; XML-only.
• Gather: Combines payloads from multiple branches; supports XML, plain text, and mixed
formats.
21. What is the use of the “Combine in Sequence” algorithm in Aggregator?
Answer:
It ensures that messages are aggregated in the order they arrive, preserving sequence integrity.
22. How does the Splitter handle large payloads?
Answer:
Splitters divide large payloads into smaller chunks for individual processing. Iterating Splitter sends
each part as a separate message, reducing memory load.
23. What are the risks of using Parallel Multicast?
Answer:
• Difficult error handling
• Race conditions
• Payload merging challenges
Use Gather or Join carefully to consolidate results.
24. How do you merge results from Multicast branches?
Answer:
Use the Gather step after Multicast to combine outputs. Ensure consistent payload formats across
branches.
25. What is the purpose of the Join step?
Answer:
Join synchronizes multiple branches into a single flow. It does not modify the payload but ensures
flow continuity.
Based on the latest expert sources, here are additional interview questions with answers focused
on the Routing Palette in SAP CPI, including Router, Splitter, Aggregator, Gather, Join, and Multicast:
SAP CPI Routing Palette – Interview Questions & Answers (Advanced Set)
26. What is the role of the “Multicast” step in SAP CPI?
Answer:
Multicast sends the same message to multiple branches. It supports:
• Parallel Multicast: Executes branches concurrently.
• Sequential Multicast: Executes branches one after another and stops on failure.
27. How does the “Join” step differ from “Gather”?
Answer:
• Join: Merges branches without modifying payloads.
• Gather: Combines payloads from branches using algorithms like Merge or Link.
28. What is the “Iterating Splitter” and when should it be used?
Answer:
Iterating Splitter sends each split part as a standalone message. It’s ideal for independent processing
of items like invoice lines or product records.
29. How do you configure a “Last Message Condition” in Aggregator?
Answer:
Use XPath or Groovy to define a condition that signals the final message in a group (e.g.,
<isLast>true</isLast>). This triggers aggregation completion.
30. What are common use cases for the “Router” step?
Answer:
• Route orders based on region or type
• Send alerts based on severity level
• Direct messages to different systems based on payload content
31. What happens if multiple Router conditions match?
Answer:
Only the first matching condition is executed. Router does not support multiple simultaneous
matches.
32. Can you use “Router” with JSON payloads?
Answer:
Yes, but XPath is not supported for JSON. Use Groovy or expression language to evaluate JSON fields.
33. How do you merge payloads after a “Splitter”?
Answer:
Use the Aggregator for XML payloads or Gather for mixed formats. Ensure consistent structure
across split messages.
34. What is the “Connection Expression” in Aggregator?
Answer:
An XPath expression used to group messages logically (e.g., by order ID or customer ID).
35. What are best practices for using “Multicast”?
Answer:
• Use Parallel Multicast for performance
• Use Sequential Multicast for error-sensitive flows
• Combine with Gather to merge results
36. How do you handle errors in “Splitter” branches?
Answer:
Wrap each branch in a Try-Catch subprocess. Use logging and fallback logic to handle failures
gracefully.
37. What is the impact of using “Parallel Multicast” with external calls?
Answer:
It may cause race conditions or overload external systems. Use Sequential Multicast or throttle
requests if needed.
38. Can you use “Join” after a “Router”?
Answer:
Yes. Join helps unify conditional branches into a single flow, especially when payload merging isn’t
required.
39. How do you test Routing Palette logic?
Answer:
• Use Trace mode
• Simulate varied payloads
• Log routing decisions using Groovy
• Validate each branch independently
40. What are the limitations of the “Aggregator” step?
Answer:
• XML-only support
• Requires correct “Last Message Condition”
• Can hang if grouping logic fails
Thanks for waiting! Based on the latest expert sources, here are more interview questions with
answers specifically focused on the Routing Palette in SAP CPI:
SAP CPI Routing Palette – Interview Questions & Answers (Expert-Level)
41. What is the purpose of the “General Splitter”?
Answer:
The General Splitter divides a message into parts while retaining the parent structure. It’s useful
when you need to process each part but still maintain the overall message context.
42. How does the “Iterating Splitter” differ from the General Splitter?
Answer:
The Iterating Splitter sends each split part as a standalone message, without the parent wrapper. It’s
ideal for independent processing of each item.
43. What is the role of the “EDI Splitter”?
Answer:
The EDI Splitter is used to split EDI messages (e.g., EDIFACT, ANSI X12) into individual transactions for
processing.
44. How do you use the “ZIP Splitter”?
Answer:
The ZIP Splitter extracts and splits files from a ZIP archive. Each file becomes a separate message for
processing.
45. What is the “Connection Expression” in Aggregator used for?
Answer:
It defines how messages are grouped for aggregation, typically using XPath to extract a common key
like order ID.
46. What is the “Last Message Condition” in Aggregator?
Answer:
It signals when the last message in a group has arrived, triggering the aggregation process to
complete.
47. What happens if the Aggregator doesn’t receive the last message?
Answer:
Aggregation hangs and the flow stalls. You must ensure the last message condition is correctly
defined to avoid this.
48. Can you use Gather with non-XML payloads?
Answer:
Yes. Gather supports XML, plain text, and mixed formats, making it more flexible than Aggregator.
49. What is the “Merge” algorithm in Gather?
Answer:
It combines payloads from multiple branches into a single structured message, often used for JSON
or flat file merging.
50. How do you ensure reliable routing in complex flows?
Answer:
• Use clear Router conditions
• Always define a default route
• Log routing decisions
• Use Join or Gather to unify branches
• Apply Try-Catch for error handling
These questions are inspired by expert guides like:
• MindMajix SAP CPI Interview Questions
• InterviewGIG SAP CPI Q&A
• ACTE SAP CPI Interview Guide
• Tech Leads IT Top 50 SAP CPI Interview Questions
Would you like a downloadable cheat sheet or a mock interview simulation next?