cancel
Showing results for 
Search instead for 
Did you mean: 

Please explain Conditional router in detail in CPI

Hi Experts,

Could you please Explain me about Conditional Routing in CPI, with example ?

Regards,

Raghavendra.

0 Kudos

CPI routers are filters that route the message based on condition. In some cases, you can write using XPath expressions or Apache Camel's Simple Language with their Router component to do this easily in code!

Is that what you mean?

Accepted Solutions (0)

Answers (3)

Answers (3)

Sriprasadsbhat
Active Contributor

Hello Raghav,

Please follow below thread that gives more details.

Few # on Content Router

1) Expression Type can be of two types 1: XML and 2: Non-XML

2) If you use Non-XML you can use Headers or Properties to decide in branch data should go.

Below is the list of operators you can use ( refer the examples ).

3) If you use XML then use the XPath and based on the same data will be routed.

4) One route should be always default.

Refer below thread and refer my comment where it shows how to route based on data existence from incoming message.

https://answers.sap.com/questions/12940277/how-to-add-router-condition-when-property-value-is.html

Regards,

Sriprasad Shivaram Bhat

former_member857521
Discoverer
0 Kudos

Hi Sriprasad Shivaram Bhat,

is there also a operator to check if a value is empty or null?

i would like to check it for a condition expression and dont want to write a groovy script for it

Thank you!

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Arkesh,

Please create a new thread for your question.

Regards,

Sriprasad Shivaram Bhat

Sriprasadsbhat
Active Contributor
0 Kudos
0 Kudos

Hi Sir,

No clarity explanation in both links.

Regards,

ragahav

arkesh_sharma
Active Participant

Hi sriprasadshivaramabhat ,

I have a similar question where I'd like to do something like -

{$header.id} = '11' and {$header.id} = '22' and ({$header.name} = 'Sriprasad' or {$header.id} = 'Arkesh' or {$header.id} = 'Rahul')

Currently I am getting an error (i.e. Invalid format of condition expression value) and I am unable to work it out. The reason I have placed first/simple brackets around the OR conditions is because the output of it should act as an input to the AND condition.

Regards,
Arkesh