Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#813175
Hi, I would like to do Mysql Load Data based on this link https://dev.mysql.com/doc/en/load-data.html.
To do it, I have to get the right file path. I was thinking to use it on trigger after input document.
So far, I've tested in PHP. But, I have no idea how to do it in Processmaker. I'm new in it.
Could someone help me how to get the file path?
#813200
You can use this code in a trigger to get the path to the Input Document file on the PM server:
Code: Select all
$inputDocId = '8145302265845d4b6db1721089633669'; //set to Input Document ID
$caseId = @@APPLICATION;
//find the UID and version for the uploaded Input Document file(s):
$query = "SELECT APP_DOC_UID, DOC_VERSION FROM APP_DOCUMENT
   WHERE APP_UID='$caseId' AND DOC_UID='$inputDocId' AND
   APP_DOC_STATUS='ACTIVE' ORDER BY APP_DOC_INDEX DESC";
$aFiles = executeQuery($query);

if (is_array($aFiles) and count($aFiles) > 0) {
   $d = new AppDocument();
   $aDoc = $d->Load($aFiles[1]['APP_DOC_UID'], $aFiles[1]['DOC_VERSION']);
   $filename = $aDoc['APP_DOC_FILENAME'];
   $ext = pathinfo($filename, PATHINFO_EXTENSION);
   $g = new G();
   $filePath = PATH_DOCUMENT . $g->getPathFromUID($caseId) . PATH_SEP .
      $aFiles[1]['APP_DOC_UID'] .'_'. $aFiles[1]['DOC_VERSION'] .'.'. $ext;
   //add your code here to send the "LOAD DATA INFILE" command to MySQL 
} 

A BC.Game Clone Script provides an investor with a[…]

Yes, Pain O Soma 500 can indeed help treat muscl[…]

VCCL is a leading web hosting service provider, re[…]

Many options exist for converting EML to CSV files[…]