Skip to Content
Technical Articles
Author's profile photo prachetas singh

SAP Cloud Integration: Generate Alert if file not found in Sender SFTP Folder

Introduction

This document provides a way to leverage existing SAP Cloud Integration functionality to raise an alert when polling for a file from source SFTP Folder does not yield any results (Specified file does not exist in source folder).

 

To achieve this use case, we will use Poll Enrich pattern of SAP Cloud Integration.

 

Possible Solution

To understand the functionality of Poll Enrich Pattern please click here.

Apart from the use cases illustrated in above blog post we can also use poll enrich to raise an exception in case no file is found in source SFTP folder.

To Achieve this:

  • In the Processing tab of poll enrich select Aggregation Algorithm as Concatenate and Check the option Throw Exception if no Message Found.

 

Poll%20Enrich

 

Error Message received in Cloud Integration
org.apache.camel.CamelExchangeException: Error occurred during aggregation. Exchange[ID-5eb31a92-e4d2-46db-50e1-2fba-1642058552768-23-1]. Caused by: [org.apache.camel.RuntimeExchangeException - Polling with given parameters did not return any message.], cause: org.apache.camel.RuntimeExchangeException: Polling with given parameters did not return any message.

 

 

 

Conclusion

Doing this, whenever the specified file is not found in source directory, CPI iFlow fails in runtime and we can use this to catch exception using an Exception Sub Process and send an alert mail to the concerned team.

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Shameer Shaik
      Shameer Shaik

      Hello ,

      By using poll enrich only one file will poll per execution.

      We have to poll multiple files from sender SFTP in one go, If files are not available in the server ,alert should be generated. Is there any workaround

       

       

      Author's profile photo prachetas singh
      prachetas singh
      Blog Post Author

      Hi Shameer

      If you are still looking for a solution and if these are specific set of files you can try below approach.

      1. Use a content modifier before Poll Enrich. In content modifier body create a XML with filename as a field.
      2. use a splitter to split the xml based on filename and save the filename in a property. Process when failure should be checked.
      3. Use the Poll enrich step as mentioned in the blog and use the filename property.
      4. catch exception and create alert.

       

      Author's profile photo Nimmala Vinod
      Nimmala Vinod

      Hello,

      I am using poll enrich to send an alert notification whenever a file is not available in SFTP Server, it works fine for all the cases, for one case even if the file is available in the server I received an alert notification.

      Please find below the error screenshot for your reference.

      Error

      Error