mysqlprocessmaker

Processmaker trigger input document get current uploaded file path


I would like to create a new mechanism. First, an user has to upload a csv file while in an input document. After that, it will automatically execute MySQL LOAD DATA INFILE for the current uploaded csv file. So, I need its path.

Could someone help me to get its path. I've tested it in PHP, but I have no idea how to do it in Processmaker.


Solution

  • That might be harder to do, whenever you perform Input Document in ProcessMaker, the platform uses a quirky way of saving file base on your APP_UID.

    Best thing you could is perform a query on the next task after submitting your input file by executing this query and get the filename generated by system:

    SELECT D.*, C.CON_VALUE FROM CONTENT C, APP_DOCUMENT D
       WHERE D.APP_DOC_UID=C.CON_ID AND D.APP_UID='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
       AND C.CON_CATEGORY='APP_DOC_FILENAME' AND D.APP_DOC_STATUS='ACTIVE'
    

    After that, you can locate your uploaded file via this link:

    /opt/processmaker/shared/sites/workflow/files/
    

    read this documentation for reference: http://wiki.processmaker.com/3.2/Input_Documents