{"id":1311,"date":"2021-01-11T10:17:00","date_gmt":"2021-01-11T09:17:00","guid":{"rendered":"https:\/\/promatis.com\/ch\/get-away-with-that-paper-using-soa-suite-and-e-post-docuguide\/"},"modified":"2023-03-27T13:03:44","modified_gmt":"2023-03-27T11:03:44","slug":"get-away-with-that-paper-using-soa-suite-and-e-post-docuguide","status":"publish","type":"post","link":"https:\/\/promatis-test.de\/ch\/get-away-with-that-paper-using-soa-suite-and-e-post-docuguide\/","title":{"rendered":"Get away with that paper using SOA Suite and E-Post\/Docuguide"},"content":{"rendered":"

[et_pb_section fb_built=\"1\" custom_padding_last_edited=\"on|tablet\" disabled_on=\"off|off|off\" admin_label=\"Sektion\" _builder_version=\"4.17.6\" _module_preset=\"default\" custom_padding=\"5vh||5vh||true|false\" custom_padding_tablet=\"5vh||5vh||true|false\" custom_padding_phone=\"5vh||5vh||true|false\" global_module=\"20\" global_colors_info=\"%91%93\" theme_builder_area=\"post_content\"][et_pb_row column_structure=\"1_4,3_4\" _builder_version=\"4.17.6\" _module_preset=\"default\" custom_margin=\"||0px||false|false\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_column type=\"1_4\" _builder_version=\"4.17.6\" _module_preset=\"default\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_image src=\"\/.\/wp-content\/uploads\/2022\/06\/Michler-Johannes-2.png?_t=1658731838\" alt=\"Johannes Michler PROMATIS Horus Oracle\" _builder_version=\"4.17.6\" _module_preset=\"default\" width=\"90%\" custom_margin=\"0vh||0vh||true|false\" border_radii=\"on|516px|516px|516px|516px\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][\/et_pb_image][\/et_pb_column][et_pb_column type=\"3_4\" _builder_version=\"4.17.6\" _module_preset=\"default\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_text ul_type=\"square\" _builder_version=\"4.19.5\" _module_preset=\"default\" text_font=\"Open Sans||||||||\" text_font_size=\"17px\" text_line_height=\"1.6em\" link_font=\"Open Sans||||on|||RGBA(255,255,255,0)|\" link_text_color=\"gcid-0becd5ff-19fc-4653-a221-c8c75771a987\" link_font_size=\"22px\" ul_font=\"Open Sans||||||||\" ul_font_size=\"17px\" ul_line_height=\"1.6em\" header_font=\"|600||on|||||\" header_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_font_size=\"47px\" header_line_height=\"1.2em\" header_2_font=\"|600||on|||||\" header_2_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_2_line_height=\"1.6em\" header_3_font=\"|600|||||||\" header_3_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_3_font_size=\"24px\" header_3_line_height=\"1.4em\" header_4_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_4_line_height=\"1.4em\" header_5_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_5_line_height=\"1.4em\" header_6_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_6_font_size=\"16px\" header_6_line_height=\"1.4em\" custom_margin=\"2vh||0px||false|false\" custom_padding=\"||||true|false\" text_font_size_tablet=\"20px\" text_font_size_phone=\"17px\" text_font_size_last_edited=\"on|tablet\" header_font_size_tablet=\"\" header_font_size_phone=\"28px\" header_font_size_last_edited=\"on|phone\" global_colors_info=\"{%22gcid-32812186-bc94-4de4-814c-2bf202477fd5%22:%91%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22,%22header_4_text_color%22,%22header_5_text_color%22,%22header_6_text_color%22,%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22,%22header_4_text_color%22,%22header_5_text_color%22,%22header_6_text_color%22,%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22,%22header_4_text_color%22,%22header_5_text_color%22,%22header_6_text_color%22%93,%22gcid-0becd5ff-19fc-4653-a221-c8c75771a987%22:%91%22link_text_color%22%93}\" theme_builder_area=\"post_content\"]<\/p>\n

Johannes Michler<\/a><\/div>\n

[\/et_pb_text][et_pb_text ul_type=\"square\" _builder_version=\"4.19.5\" _module_preset=\"default\" text_font=\"Open Sans||||||||\" text_font_size=\"17px\" text_line_height=\"1.6em\" link_font=\"Open Sans||||on||||\" link_text_color=\"#00A9A0\" ul_font=\"Open Sans||||||||\" ul_font_size=\"17px\" ul_line_height=\"1.6em\" header_font=\"|600||on|||||\" header_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_font_size=\"47px\" header_line_height=\"1.2em\" header_2_font=\"|600||on|||||\" header_2_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_2_line_height=\"1.6em\" header_3_font=\"|600|||||||\" header_3_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_3_font_size=\"24px\" header_3_line_height=\"1.4em\" header_4_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_4_line_height=\"1.4em\" header_5_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_5_line_height=\"1.4em\" header_6_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_6_font_size=\"16px\" header_6_line_height=\"1.4em\" custom_margin=\"1vh||0px||false|false\" custom_padding=\"||||true|false\" text_font_size_tablet=\"20px\" text_font_size_phone=\"17px\" text_font_size_last_edited=\"on|tablet\" header_font_size_tablet=\"\" header_font_size_phone=\"28px\" header_font_size_last_edited=\"on|phone\" global_colors_info=\"{%22gcid-32812186-bc94-4de4-814c-2bf202477fd5%22:%91%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22,%22header_4_text_color%22,%22header_5_text_color%22,%22header_6_text_color%22%93}\" theme_builder_area=\"post_content\"]<\/p>\n


Senior Vice President<\/strong> \u2013\u00a0Head of Platforms\u00a0&\u00a0Development<\/p>\n

[\/et_pb_text][et_pb_text ul_type=\"square\" _builder_version=\"4.17.6\" _module_preset=\"default\" text_font=\"Open Sans||||||||\" text_text_color=\"gcid-0becd5ff-19fc-4653-a221-c8c75771a987\" text_font_size=\"22px\" text_line_height=\"1.6em\" link_font=\"Open Sans||||on||||\" link_text_color=\"#00A9A0\" ul_font=\"Open Sans||||||||\" ul_font_size=\"17px\" ul_line_height=\"1.6em\" header_font=\"|600||on|||||\" header_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_font_size=\"47px\" header_line_height=\"1.2em\" header_2_font=\"|600||on|||||\" header_2_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_2_line_height=\"1.6em\" header_3_font=\"|600|||||||\" header_3_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_3_font_size=\"24px\" header_3_line_height=\"1.4em\" header_4_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_4_line_height=\"1.4em\" header_5_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_5_line_height=\"1.4em\" header_6_text_color=\"gcid-32812186-bc94-4de4-814c-2bf202477fd5\" header_6_font_size=\"16px\" header_6_line_height=\"1.4em\" custom_margin=\"5px||0px||false|false\" custom_padding=\"||||true|false\" text_font_size_tablet=\"20px\" text_font_size_phone=\"17px\" text_font_size_last_edited=\"on|tablet\" header_font_size_tablet=\"\" header_font_size_phone=\"28px\" header_font_size_last_edited=\"on|phone\" global_colors_info=\"{%22gcid-32812186-bc94-4de4-814c-2bf202477fd5%22:%91%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22,%22header_4_text_color%22,%22header_5_text_color%22,%22header_6_text_color%22,%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22,%22header_4_text_color%22,%22header_5_text_color%22,%22header_6_text_color%22,%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22,%22header_4_text_color%22,%22header_5_text_color%22,%22header_6_text_color%22%93,%22gcid-0becd5ff-19fc-4653-a221-c8c75771a987%22:%91%22text_text_color%22%93}\" theme_builder_area=\"post_content\"]<\/i><\/a><\/i><\/a><\/i><\/a>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section fb_built=\"1\" _builder_version=\"4.16\" _module_preset=\"default\" custom_padding=\"0vh||10vh||false|false\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_row use_custom_gutter=\"on\" _builder_version=\"4.17.3\" _module_preset=\"default\" custom_padding=\"0px||0px||true|false\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_column type=\"4_4\" _builder_version=\"4.16\" _module_preset=\"default\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][et_pb_text _builder_version=\"4.17.4\" _module_preset=\"default\" background_enable_color=\"off\" global_colors_info=\"{%22gcid-32812186-bc94-4de4-814c-2bf202477fd5%22:%91%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22%93,%22gcid-0becd5ff-19fc-4653-a221-c8c75771a987%22:%91%22background_color%22%93}\" theme_builder_area=\"post_content\"]<\/p>\n

A customer recently told me they would like to get away from having to print, envelope and post mark thousands of invoices manually every month. Even though we have changed their invoicing process to an electronic one for most of their customers years ago by sending out emails through Oracle SOA Suite, they still had a considerable amount of customers insisting on printed invoices delivered by post.<\/p>\n

Let\u2019s have a look at how we managed to get away with that paper.<\/p>\n

Starting Point<\/h3>\n

The customer was producing his invoices using the Oracle ERP System Oracle E-Business Suite (EBS) running on OCI. For electronic invoices, EBS has for a long time passed on the invoice and eventually some more additional attachments further detailing the invoices to Oracle SOA Suite 12.2.1.4. Then an integration layer running on SOA Suite delivered the invoices to the customer by sending (in most cases) an email with one or multiple (PDF) attachments.<\/p>\n

Customers not opting in for this electronic process got their invoice printed through a traditional E-business Suite concurrent program on a printer at the customer premises. From there, the invoice was eventually enriched with the necessary attachments, then put in an envelope and sent to the customer by post.<\/p>\n

Docuguide<\/h3>\n

Since the process of sending, printing, enveloping and post marking paper is both a lot of work and expensive, the customer thought of outsourcing this task to Deutsche Post and its service docuguide\/E-Post. They offer to print, put in an envelope and deliver\/postmark a letter with a single page at 0,65\u20ac which is far below the price for the stamp alone (0,80\u20ac).<\/p>\n

The data can be transmitted to docuguide over various interfaces, e.g. by a special printer driver, but also using (s)ftp upload or a modern web service API (https:\/\/api.epost.docuguide.com\/swagger\/index.html#\/Letter\/LETTER_POST<\/a>).<\/p>\n

Implementation<\/h3>\n

The basic implementation was quite trivial: I modified the E-business Suite process to not only pass electronic invoices over to SOA Suite, but instead to pass everything along. Furthermore, we deactivated the printing of the invoices in EBS itself.<\/p>\n

In the SOA Suite process, we then performed a simple \u201cif\u201d to send invoices that need to be delivered physically to docuguide. This can be done by using either the REST Web Service or the SFTP Adapter. Since Docuguide confirmed the traditional SFTP channel to be more flexible for now, we applied this approach for the time being:<\/p>\n

[\/et_pb_text][et_pb_image src=\"https:\/\/promatis.com\/wp-content\/uploads\/2023\/02\/get-away-with-this-paper-using-SOA1-1.jpg\" title_text=\"get-away-with-this-paper-using-SOA1\" _builder_version=\"4.19.5\" _module_preset=\"default\" hover_enabled=\"0\" global_colors_info=\"{}\" theme_builder_area=\"post_content\" sticky_enabled=\"0\"][\/et_pb_image][et_pb_text _builder_version=\"4.17.4\" _module_preset=\"default\" background_enable_color=\"off\" global_colors_info=\"{%22gcid-32812186-bc94-4de4-814c-2bf202477fd5%22:%91%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22%93,%22gcid-0becd5ff-19fc-4653-a221-c8c75771a987%22:%91%22background_color%22%93}\" theme_builder_area=\"post_content\"]<\/p>\n

Attachment challenges<\/h3>\n

As mentioned earlier, we had cases where not only a single invoice had to be delivered to the customer but instead we had to add 1 or even multiple additional documents to the letter. In the electronic case, this was trivial since we simply attached multiple documents (PDF) to the Email.<\/p>\n

However, with the Deutsche Post interfaces we had to merge all these documents into a single, combined PDF. SOA Suite unfortunately does not provide any out of the box functionality to merge PDFs. Using a Java Embedding and one of many libraries to merge PDFs using Java Source Code, this can be achieved easily with the following steps:<\/p>\n

[\/et_pb_text][et_pb_image src=\"https:\/\/promatis.com\/wp-content\/uploads\/2023\/02\/get-away-with-this-paper-using-SOA2.jpg\" title_text=\"get-away-with-this-paper-using-SOA2\" _builder_version=\"4.19.5\" _module_preset=\"default\" global_colors_info=\"{}\" theme_builder_area=\"post_content\"][\/et_pb_image][et_pb_text _builder_version=\"4.17.4\" _module_preset=\"default\" background_enable_color=\"off\" global_colors_info=\"{%22gcid-32812186-bc94-4de4-814c-2bf202477fd5%22:%91%22header_text_color%22,%22header_2_text_color%22,%22header_3_text_color%22%93,%22gcid-0becd5ff-19fc-4653-a221-c8c75771a987%22:%91%22background_color%22%93}\" theme_builder_area=\"post_content\"]<\/p>\n

    \n
  1. Load the appropriate PDF merging library (.jar files) into WEB-INF\/lib of the soa composite sending the invoices:<\/li>\n
  2. Implement a Java embedding Activity in the BPEL process similar as the following :<\/li>\n<\/ol>\n
    \n

    Integer numsI = ( Integer) getVariableData( \u201cnumAttachs\u201d);<\/p>\n

    int num = numsI.intValue();<\/p>\n

    java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();<\/p>\n

    org.apache.pdfbox.multipdf.PDFMergerUtility PDFmerger = new org.apache.pdfbox.multipdf.PDFMergerUtility();<\/p>\n

    PDFmerger.setDestinationStream( bos);<\/p>\n

     <\/p>\n

    for ( int i = 1; i <= num; i++) {<\/p>\n

    oracle.xml.parser.v2.XMLElement xmle = ( oracle.xml.parser.v2.XMLElement) getVariableData(<\/p>\n

    \u201cRead_Attachment_OutputVariable\u201d, \u201cXxArDigitalInvoicesDocVCollection\u201d,<\/p>\n

    \u201c\/\/ns10:XxArDigitalInvoicesDocV[\u201d + i + \u201c]\/ns10:fileData\u201d);<\/p>\n

    String nextBase64 = xmle.getTextContent().replace( \u201c\\n\u201d, \u201c\u201d).replace( \u201c\\r\u201d, \u201c\u201d);<\/p>\n

    java.io.InputStream is1 = new java.io.ByteArrayInputStream(<\/p>\n

    java.util.Base64.getDecoder().decode( nextBase64));<\/p>\n

    PDFmerger.addSource( is1);<\/p>\n

    }<\/p>\n

     <\/p>\n

    PDFmerger.mergeDocuments( org.apache.pdfbox.io.MemoryUsageSetting.setupMainMemoryOnly());<\/p>\n

    String result = java.util.Base64.getEncoder().encodeToString( bos.toByteArray());<\/p>\n

    setVariableData( \u201cbase64_out\u201d, result);<\/p>\n<\/blockquote>\n

    This combines all the PDFs to be sent to one customer into a single pdf that can then be sent to docuguide for delivery to the customer.<\/p>\n

    We used the\u00a0<\/span>https:\/\/pdfbox.apache.org\/download.cgi<\/a>\u00a0<\/span>library because it is under the Apache License 2, which is quite permissive also in a commercial environment. Be aware e.g. of libraries under GPL or even AGPL depending on your environment (e.g. itext).<\/p>\n

    Summary<\/h2>\n

    The above procedure allowed us to replace a manual, expensive and error prone process (the number of pages per invoice varies making it difficult to correctly put the matching pages into an envelope) with a more convenient and way cheaper process within days. Especially, the flexibility of SOA Suite in combination with the powerful document printing means of Oracle E-Business Suite helped to implement a way better solution than the customer was running before.<\/p>\n

    [\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"

    A customer recently told me they would like to get away from having to print, envelope and post mark thousands of invoices manually every month. Even though we have changed their invoicing process to an electronic one for most of their customers years ago by sending out emails through Oracle SOA Suite, they still had a considerable amount of customers insisting on printed invoices delivered by post.<\/p>\n","protected":false},"author":2,"featured_media":1277,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"2880","footnotes":""},"categories":[23],"tags":[88,103,104],"dipi_cpt_category":[],"class_list":["post-1311","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-techblog","tag-e-business-suite","tag-ebs-20-0-1-1","tag-oracle-ebs"],"_links":{"self":[{"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/posts\/1311"}],"collection":[{"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/comments?post=1311"}],"version-history":[{"count":0,"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/posts\/1311\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/media\/1277"}],"wp:attachment":[{"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/media?parent=1311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/categories?post=1311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/tags?post=1311"},{"taxonomy":"dipi_cpt_category","embeddable":true,"href":"https:\/\/promatis-test.de\/ch\/wp-json\/wp\/v2\/dipi_cpt_category?post=1311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}