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
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
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
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