Skip to Content
author's profile photo Former Member
Former Member

From other interface defined file name to pick via file adapter

Hi,

I got a problem which is not clear to me how to solve.

There are 2 interfaces.

a) IDOC to XML

b) pdf to zip

Interface a) contains a doc number that determines the file name of the pdf to pick in the second interface.

Interface a) is simple and clear

Interface b) requires to pick the right file and bring it together with the xml file because both need to be put into the same zip file.

First question is: How to get the doc number into a function that determines the right pdf file.

Seems this would be the process logic:

- ccBPM starting with an IDOC, getting the doc number via dynamic config

- use the doc number to generate the correct pdf file name.

=> and now:

- hand over the file name to the sender file adapter to pick the right file (this would be the tricky part. No idea how to do that)

- generate the xml output file from the IDOC

- use file receiver adapter with zip module to put both files into the same zip

Probably there will be more issues on the way but I would start with the first one.

Any ideas how to pick the right pdf file?

Best regards

Dirk

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Aug 12, 2016 at 03:44 PM

    Dirk,

    Use file Adapter at receiver and save XML file locally on you PI Server and make sure that you have all the info required to read PDF file in this xml file.

    call a Script from your File adapter. Within Script read xml file to get PDF and zip them together.

    Then u can use FTP/SFTP command within the Script to send the Zipped file.

    Thanks,

    Sunil Singh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 15, 2016 at 03:05 AM

    Hi Meinhard,

    - ccBPM starting with an IDOC, getting the doc number via dynamic config

    - use the doc number to generate the correct pdf file name.

    There is no need to use dynamic config to get the idoc number. The idoc number field is called DOCNUM and it is located under the EDI_DC40 segment (IDoc control record).

    => and now:

    - hand over the file name to the sender file adapter to pick the right file (this would be the tricky part. No idea how to do that)

    As far as I know this is not possible. However, you can get the PDF file via:

    a. RFC Lookup, the function module would look in the directory the pdf should be located and will return it in base64 format. You can set its property to read-only (after reading) and have an external script clean the directory or archive it.

    b. Java IO api, you can directly read the file from the directory same as A. The cleanup procedure is also the same as A.

    The PDF should be created as an attachment.

    - generate the xml output file from the IDOC

    - use file receiver adapter with zip module to put both files into the same zip

    Working with the PayloadZipBean module of the XI Adapter Framework

    Edit: Sunil's suggestion should work if the third party agrees to drop both the idoc and pdf in the same directory and both are available for the sender channel to read at the same time..

    Regards,

    Mark

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 15, 2016 at 04:45 AM

    Hi Dirk,

    If you are using ccBPM, using correlation to identify which pdf file read using the file adapter correlates with the IDoc field containing the file name will help. You will have to introduce a new field to hold the file name though.

    Otherwise reading the file in a Java Mapping or RFC, as mentioned by Mark above, will be another approach to handle this.

    Regards,

    Sanjeev

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 15, 2016 at 07:42 AM

    Hi,

    thank you so far for your input.

    I really appreciate them! This ill help me a lot!

    I will go trough them and check them and decide for the best was to get my results.

    Best regards

    Dirk

    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.