Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
jorgkerkhofaiden
Explorer

Introduction:
While working on a client's SAP Cloud Integration setup, I encountered an unexpected behavior with the Router module that I couldn't explain.
Messages weren't being directed where they should be. Determined to resolve this issue, I did a bit of a deep dive into understanding how the Router functions. This blog presents the results.

Unraveling the Router:
The Router module serves as a traffic controller for messages within SAP Cloud Integration, determining their destinations based on specific conditions, such as payload content (e.g., properties/headers).
In this particular case, I observed different behavior depending on whether a condition was set using a Property or XPath.

Understanding Conditions:
The Router's decisions are based on conditions that you set. These conditions, consisting of symbols like '=', '!=', '>', and '<', enable the Router to take a route.

Exploring Scenarios:
Let's examine some examples to illustrate how the Router behaves in various situations.
Consider using a property to determine a message's destination.
Depending on the presence or absence of that property, the Router's behavior may differ from when using the XPath function.

In the following image, you can see the behavior of a property named "router_test."
Scenarios 1-4 show the result when the property is available in the iFlow, while scenarios 5-8 show the property not being present in the iFlow but being defined in the router condition.
Legend: (Green notes a valid condition, while Red indicates an invalid condition)
scen1.JPG

In the second image, you can see the test results when using a XPath expression.
The behavior differs from using a property.
In this case, the field used in the condition does not exist in the XML in scenarios 5-8, yet it behaves as expected, in my opinion.

scen2.JPG


Possible Solution/Advice:

To ensure predictable behavior from the Router, it's crucial to maintain consistency.
Ensure that your property field is consistently present.
In this specific customer case, a script running before the router module did not always create the property.
I modified the script to always create the property, even when there was no data, while keeping the property value empty.

Conclusion:
Understanding how the Router works is key to making SAP Cloud Integration run smoothly.
Hopefully this blogs helps you to understand the router better and don't get stuck on the same problem I was facing.

1 Comment
ShaikAzmathulla
Participant
0 Kudos

Hi ,

Informative blog . 

Regards , 

Azmath. 

Labels in this area