Skip to Content
avatar image
Former Member

Empty File handling and raise alert.

Hi,

We have requirement where we are doing file pass through. But client wants PI to raise alert when it receives 0 byte file.

How can we achieve this using File/FTP/SFTP adapter when we are not reading the actual payload and doing only pass thru?

Thanks,

Vertika

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Mar 18, 2014 at 07:43 PM

    Hi Vertika,

    AFAIK - there is no standard way for pass through interface to raise alert (for empty file). so you need to develop adapter module to raise the alert for empty file.

    Please refer the help page

    Configuring the Sender File Adapter - Advanced Adapter Engine - SAP Library

    Under Handling of Empty Files, specify how empty files (length 0 bytes) are to be handled:

    • Do Not Create Message No XI messages are created from empty files.The files are processed according to the selected processing mode.For example, if the processing mode is Delete, empty files are deleted in the source directory.
    • Process Empty Files XI messages are created with an empty main payload.The files are processed according to the selected processing mode.
    • Skip Empty Files No XI messages are created from empty files.Empty files are skipped and remain in the source directory.
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Harish,

      I know the empty file handling configuration is available in adapter channel. But in order to raise the alert as you said adapter module will be required.

      Can you please provide some details on adapter module?

      Thanks,

      Vertika

  • avatar image
    Former Member
    Mar 18, 2014 at 08:06 PM

    Hi ,

    You can easily handle the scenario using Custom module .

    Here is the logic:

    1)Create the sender data type with additional field status 0..1

    2)In sender channel check process empty files option .

    3In custom module read the payload and check whether it is empty .

    If it is empty then populate xml o/p payload as your mt mt,namespace<status>NV</status><mt>

    If it is not empty then add this <status>V</status> after main namespace tags and then actual xml payload ,populate as custom module xml o/p

    Now in receiver determination check the status field value and based on that draft either mail or actual mapping .

    Here you have 2 mappings

    1 Mail

    1 Normal mapping .

    I just given a rough idea.Think on it you can find better sol.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Amit Srivastava

      Hi ,

      I thought of suggesting the above as well ,but strike to my mind lately 😊 .Any how above is the better solution than above suggested by me .

      In RD-->XPATH editor select context Object-->SourceFileSize Notequals 0 targetsystem

      If no receiver found ,Process as Follows :

      select the following receiver (MAILCOMPONENT)

      Regards

      Venkat

  • avatar image
    Former Member
    Mar 19, 2014 at 03:18 AM

    Thanks for suggestion's. Just wanted to get some more clarification on alert part.

    When you say throw exception if size is not equals to 0, then how exactly we can raise the alerts. One way could be not defining any receiver for that condition, but in this case the exception would always say "InterfaceDetermination did not yield any actual interface".

    Can you please elaborate on exception and alert part?

    Thanks,

    Vertika

    Add comment
    10|10000 characters needed characters exceeded

    • Hello,

      >>One way could be not defining any receiver for that condition, but in this case the exception would always say "InterfaceDetermination did not yield any actual interface".

      In my previous reply i have just given u a pointer about how to check file size using standard way and route/fail interface.

      And yes, indeed if u want to throw custom alert (stating that file size if zero or something else) then u have to add another receiver and send mail using mail adapter - that's the easy solution i can think of.

      Thanks

      Amit Srivastava