Skip to Content

Sender file adapter - check files before transmission to PI

Hello!

Our partner puts 2 files on a ftp server:

123.txt

123.pdf

Our goal is only to transmit the files if both files (same filename with extensions .txt and .pdf) are available. Sometimes the printed version (.pdf) is available later and then the .txt file should not be pulled as long as the .pdf is not available.

Does anyone know how to solve this problem?

Thanks in advance for your help!

Best regards

Christian

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Feb 24, 2015 at 01:55 PM

    Hi Christian

    The general idea provided by the rest above to use "Additional files" feature is the right direction.

    However, if you need the .txt files to be picked up ONLY when the .pdf is present, I would suggest the configuration below:-

    i) Set *.pdf as the filename mask for files to pick up

    ii) Set .txt as the additional file to pick up optional = NO

    This is because the PDF comes later, so it should be the "trigger" file that initiates the pick up of both files.

    Additionally, for this approach, if you want to just transmit the .txt file to the end location (you did not mentioned where it's going - file, proxy, idoc, etc), you will need to use PayloadSwapBean to swap the .txt file into the main payload.

    There are some screenshots for such configuration in my article below. The article is for a different requirement, but the screenshots relevant to your case is in Scenario 2 section.

    How to pick up files with filename dynamically specified in message content

    Rgds

    Eng Swee

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2015 at 12:13 PM

    Hi Christian,

    Assuming you're sending the .pdf files just as attachment, you can use 'Additional File' feature available for Sender File Adapter. Here's the help document for the same.

    You can set <Additional FileN>.optional as 'NO' to trigger errors, if files are not present.

    Hope this helps.

    PS. Don't forget to give points. 😊

    Regards

    Bibek

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2015 at 08:51 AM

    Hi Christian

    It's getting a bit hard to see the replies as they are being squeezed so I'm replying under the main question instead.

    Try following the setup in my blog instead.

    How to pick up files with filename dynamically specified in message content

    Instead of CSV in the screenshot below use TXT, and in the SwapBean, swap by Payload-Name with value of TXT.

    Rgds

    Eng Swee


    swap.png (115.0 kB)
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.