Clarity

  • 1.  How to read excel file data from knowledge store in processes

    Posted Oct 13, 2017 10:24 AM

    I have attached an Excel file in Knowledge store. I need to read the excel file data from Knowledge store in Processes.



  • 2.  Re: How to read excel file data from knowledge store in processes
    Best Answer

    Posted Oct 13, 2017 11:14 AM

    The file contents will be in the clb_dms_file_store table ( file_contents column contains the file in binary format )

     

    So your process needs to be able to decode that file_contents somehow - you might find that calling a database procedure (from your process) will be easier than trying to handle it all in the process (i.e. in a GEL script) though. (I'm sure you could handle it in GEL, but database just seems easier to me?)



  • 3.  Re: How to read excel file data from knowledge store in processes

    Posted Oct 20, 2017 09:23 AM

    Hi David,

     

    Thanks for the info.

     

    Do you have any sample gel script code for the above process could you please share with me.

     

    Thanks,

    Satya



  • 4.  Re: How to read excel file data from knowledge store in processes

    Posted Oct 20, 2017 11:46 AM

    sbhoopalam wrote:

     

    Do you have any sample gel script code for the above process could you please share with me.

     

    No sorry - I've only ever done it with XML data (not even XML format Excel documents) stored in the knowledge store, and then via DB procedure rather than GEL (which is why I suggested it  )

     

    Gene's suggestions about the apache library(s) to use would be the GEL solution... but I'm well out of my depth when we start going there



  • 5.  Re: How to read excel file data from knowledge store in processes

    Posted Oct 13, 2017 11:59 AM

    To read an excel file with GEL, you will need to leverage the poi.apache.org library either HSSF or XSSF classes depending on the excel format -- xls vs xlsx.

     

    The HSSFWorkbook and XSSFWorkbook class constructors accept a java.io.InputStream so you will need to get the file_contents (Dave's post) into an inputstream.

     

    So on your query against clb_dms_file_store, just get the file_contents blob from the queried resultset and once you have the blog you can pass the an inputstream via the getBinaryStream method on the blob.

     

    V/r,

    Gene