BPM, Workflow, and Case

 View Only
Expand all | Collapse all

Attach Coach as a document

  • 1.  Attach Coach as a document

    Posted Wed July 24, 2024 09:29 AM

    We have a potential workflow where a user wants to make a coach a potential document.  The reason for this being is the users currently have a process where they send the information being input on the coach to a contact person that is outside of the company for review.  So ideally we want it to where they can fill out the coach, attach that information input into the activity as a document to grab at a later point in time?  Is this doable, and if so, how?



    ------------------------------
    Nicole Smith
    ------------------------------


  • 2.  RE: Attach Coach as a document

    Posted Wed July 24, 2024 11:46 PM

    Hi Nicole,

    Definitely it is feasible technically, the approach would depend on the requirement/specification of the document. 

    If you are looking to generate a PDF then there can be multiple ways of doing it - 

    1. Using  a JavaScript library like jsPDF, you can easily convert the HTML content of the coach into PDF.
    2. If you are looking to create more fine grained PDF with customized style, you can use a Java library like Apache PDFbox to create the PDF dynamically based on the content of the Coach.

    Obviously, after creating the document you can associate that with the process instance and upload to the BPM Document Store.

    Thanks!



    ------------------------------
    Atanu Roy
    Lead Engineer
    London Stock Exchange Group
    ------------------------------



  • 3.  RE: Attach Coach as a document

    Posted Thu July 25, 2024 06:47 AM
    Edited by Grant Taylor Thu July 25, 2024 06:47 AM

    We did an internal prototype with the PDFreactor libraries (https://www.pdfreactor.com/).  I can share those assets with you if you are interested.  The goal of this prototype was to export a PDF from a coach, which is part of what you need.



    ------------------------------
    Grant Taylor
    ------------------------------



  • 4.  RE: Attach Coach as a document

    Posted Fri July 26, 2024 01:43 AM

    Hi Nicole,

    Yes like others have suggested, generating a pdf would be the way to go. This is easily done with any open Java libraries to convert html to pdf. We are doing a lot of this in our projects as well.

    Regards



    ------------------------------
    Thong Huynh
    Sydney
    ------------------------------



  • 5.  RE: Attach Coach as a document

    Posted Fri September 06, 2024 10:44 AM

    Hello Thong,
    I know this thread is a few months old at this point but I'm working around this issue currently and wanting to leverage Java libraries as you said to convert the HTML to PDF. The struggle I'm having is attempting to isolate the usable HTML in question from all the excess bits of wrapping code and getting the HTML in question to actually come out looking like the coach view itself. Is there a way that you're familiar with to cleanly isolate the HTML element for use in converting?



    ------------------------------
    Dustin Mulligan
    ------------------------------



  • 6.  RE: Attach Coach as a document

    Posted Fri September 06, 2024 11:10 AM

    Hey Dustin,

    Interesting, but I'm not sure if I fully understand what you mean by isolating the HTML. We have tw local variables embedded across the HTML then the final HTML with rendered values will be provided to the Java integration component to generate the PDF. It's not re-usable as the implementation is unique to the PDF format that is being generated. Maybe if you can elaborate the your idea a bit clearer with some diagrams?

    Thanks



    ------------------------------
    Thong Huynh
    Sydney
    ------------------------------



  • 7.  RE: Attach Coach as a document

    Posted Fri September 06, 2024 11:25 AM

    I think this is where the disconnect is because what I was hoping to accomplish was to be reusable across multiple coaches by simplifying the process pulling the entire HTML element that generates the coach and feeding that into a conversion application. What you're describing sounds closer to (though maybe I'm misunderstanding) my backup option which was to feed data points likely in the form of an XML or JSON into an application which then would generate a PDF from those data points. That said, at this point I'm almost entirely reliant on out of the box components and have done very little custom HTML within coaches so there may be some functionality that exists using custom HTML that I'm missing out completely on. I am still a relatively new user so I'm still feeling things out and I'm positive there's more functionality that isnt being utilized to its fullest extent.



    ------------------------------
    Dustin Mulligan
    ------------------------------



  • 8.  RE: Attach Coach as a document

    Posted Fri September 06, 2024 11:33 AM

    The prototype I mentioned above, using PDFReactor, used the HTML from the rendered coach to generate the PDF.



    ------------------------------
    Grant Taylor
    ------------------------------



  • 9.  RE: Attach Coach as a document

    Posted Fri September 06, 2024 11:43 AM

    What's the architecture like for that setup? We have an in house application capable of converting HTML into a PDF but likely wont be looking to bring in any new products at this point. Do you at any point capture the HTML from the rendered coach to pass to a service and if so, how do you go about it?



    ------------------------------
    Dustin Mulligan
    ------------------------------



  • 10.  RE: Attach Coach as a document

    Posted Fri September 06, 2024 12:49 PM
      |   view attached

    I've uploaded a zip of our internal git repo for our prototype.  It has sample twx files that you can import and see the code, plus readme files that describes what was done to obtain the HTML and CSS for the coach.  Hope this helps.



    ------------------------------
    Grant Taylor
    ------------------------------

    Attachment(s)

    zip
    PDFReactor-main.zip   27.21 MB 1 version


  • 11.  RE: Attach Coach as a document

    Posted Sun September 08, 2024 08:21 PM

    Hey Dustin,

    I think I understand what you're after now. 

    I would just CSS your coaches so they are printable (https://www.htmlgoodies.com/css/creating-printable-web-pages-using-css/)

    This way, your users can always print out a coach if they wanted to.

    Does this work for you?

    Thanks,

    Thong



    ------------------------------
    Thong Huynh
    Sydney
    ------------------------------