cancel
Showing results for 
Search instead for 
Did you mean: 

Terminate message with empty no "Records" in SAP CPI

former_member60331
Participant
0 Kudos
1,089

Hi Experts,

I have two incoming xmls from source system and I have a requirement to not send the xml with no "Records" to target.

XML-1 :

XML-2:

I want to terminate the messages for XML-2 in CPI. Can this be done using router in CPI?

Regards,

Akash1.xml2.xml

Accepted Solutions (1)

Accepted Solutions (1)

manoj_khavatkopp
Active Contributor

Hi Akash ,

Try the below XPATH in router :

/PortalResponse/Records[*]

Thanks,

Manoj K

Answers (2)

Answers (2)

Sriprasadsbhat
Active Contributor

Hello Akash,

It depends on your scenario.If you are having HTTP sender or SFTP where you need to put validation at the begining of your iflow then you can use router.

You can take any one of the fields inside Records which comes always to set the condition in router.Below example should work for you .

/AribaResponse/Records/boolean(IsTestProject) 

In case you are doing some enrichment where some of the records have valid and som has invalid,then you can use multicast with Content Filter to group of valid records.

Regards,

Sriprasad Shivaram Bhat

former_member60331
Participant
0 Kudos

Hi Sriprasad,

Thank you for your answer.
Currently I am managing the routing with the similar condition.

//IsTestProject = 'true' or //IsTestProject = 'false'

Out of curiosity, just wanted to check is there is way put some condition on "Records" itself.

Regards,

Akash

babruvahana
Contributor
0 Kudos

Hi Akash,

Are you clubbing the messages from both the sources? If yes, then you can add a filter step to remove the nodes which ch doesn't have any records.

Regards

Pavan