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: 
former_member540493
Participant

Introduction


In a CPI integration project, we had the challenge that we should use SFTP sender to pickup files, those should be routed differently based on the file name.

I will explain the found solution using a concrete example




We have 2 files on the same SFTP server in the same folder, these differ only in the name, for example test1.txt and test2.txt, these should be processed differently as mentioned above and have to be rooted to different SFTP server / folder


 

 

IFlow




 

Solution


We used the Router, so we have 2 processing variants, thus come to the important part of this blog.

To set the routing condition, 2 steps have to be implemented as shown in the picture below

Step1

  • Expression Type: have to be set to Non-XML


Step2

  • ${header.CamelFileName} = 'test1.txt'




 

This have to be also implemented for the second routing, with the related  file name obviously.

 

More Information


The Expression Type drop-down list is important. It contains the values XML and Non-XML. The selected value influences the way the Condition field is interpreted by the execution engine during run time. If XML is chosen, the condition is interpreted as an XPath expression. If Non-XML is chosen, it is interpreted as an expression using Camel variables (among other things, this allows access to the variable headers).

 

To learn more about CPI Runtime Variables, feel free to follow the link

https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/d0fcb0988f034e889f611c6e36d...

 

The Runtime Variables could also used with operators based on Apache Camel simple Language (check the point - OPERATOR SUPPORT)

 



 

I hope this blog post is useful


Youssef
Labels in this area