Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#790041
Dearl all,
I read document http://wiki.processmaker.com/index.php/ ... dDoc.28.29

I tried and successed when tets trigger
- Create a folder in Alfresco Repository
code: createFolder("http://172.16.0.35:8080/alfresco", "Sites/", "testCreateFolder", "admin", "Pemiu102a@");:
- Delete an object(Folder/File) from Alfresco Repository
code: deleteObject("http://172.16.0.35:8080/alfresco", "a5492a8c-3485-4e31-9c87-bf1017c0f308", "admin", "Pemiu102a@");

But when i try trigger: uploadDoc(string alfrescoServerUrl, string fileSource, string fileTitle, string fileDesc, string docType, string user, string pwd)

I don't input parameters
uploadDoc.png
uploadDoc.png (22.56 KiB) Viewed 14452 times
Can you help me.
I using PM: 3.0.1.18, Alfresco: 4.0
#790058
Dear mishika,
According document, service Upload file/document in Alfresco Repository - uploadDoc():
string uploadDoc(string alfrescoServerUrl, string fileSource, string fileTitle, string fileDesc, string docType, string user, string pwd)
- alfrescoServerUrl: Server name and port where Alfresco is installed.
- fileSource: Source of the File from where the file will be uploaded.
- fileTitle: Title of the File.
- fileDesc: Description of the File.
- docType: Type of File.
- user: Valid username to connect to Alfresco server
- pwd : Valid Admin password to connect to Alfresco server

But, in PM 3.0.1.18, service uploadDoc was changed parameters
It adds: Path of document to be Uploaded, The main folder in alfreco to save the files

I don't know how to enter parameters.
#790062
Hello,

The additional parameters for Alfresco trigger in ProcessMaker 3 are:
- path: Path of Document on your local machine that is to be uploaded, like, "/opt/processmaker/path/to/document".
- folder: Folder name in alfresco where you will be saving the files.

These two parameters will be added to the definition of the function and the function will be as follows:
string uploadDoc(string alfrescoServerUrl, string fileSource, string fileTitle, string fileDesc, string docType, string user, string pwd, string path, string folder)

Hope this helps

Best Regards
Mishika
#790066
I create a ProcessDemo upload document from PM to Alfresco
PMToAlfresco.png
PMToAlfresco.png (6.65 KiB) Viewed 14405 times
First task:
screen_uploadFile.png
screen_uploadFile.png (71.44 KiB) Viewed 14405 times
In first task, user click the button File upload, choose document to upload from local machine: ex: C:/Users/chieunh.ho/Downloads/testUpload.png
When first task completed, i called trigger uploadDocument
Code trigger: @@result = uploadDoc(@@alfrescoServerUrl, @@fileSource, @@fileTitle, @@fileDesc, @@docType, @@user, @@pwd, @@filePath, @@folderUpload);
trigger_uploadDocument.png
trigger_uploadDocument.png (59.62 KiB) Viewed 14405 times
I want upload file to Alfresco server, not upload to PM server.
Is it possible?
#814409
I finally solved this by creating a trigger in processmaker 3.2
Here is the example of the trigger for uploading multiple files in alfresco 5.2
Code: Select all
$caseId    = @@APPLICATION;
$File= executeQuery("select APP_DOC_FILENAME ,APP_DOC_UID from app_document where APP_UID = '".$caseId."'");

for ($i=0; $i<= count($File); $i++) {
    $APP_DOC_FILENAME = $File[$i]['APP_DOC_FILENAME'];
    $APP_DOC_UID = $File[$i]['APP_DOC_UID'];
      
    $EXT = executeQuery("SELECT CON_VALUE FROM CONTENT WHERE CON_ID='$APP_DOC_UID' AND CON_CATEGORY='APP_DOC_FILENAME'");
      
    $CON_VALUE = $EXT[1]['CON_VALUE'];     
    $EXTENSION = substr($CON_VALUE, strpos($CON_VALUE, ".") );
       
    $g = new G();
    $filePath  = PATH_DOCUMENT . $g->getPathFromUID($caseId) . PATH_SEP . $APP_DOC_UID . "_1" . $EXTENSION;  
    $data['filedata'] = new CURLFile($filePath,'text/plain',$APP_DOC_FILENAME);
     
    $ch = curl_init('http://localhost:9080/alfresco/api/-default-/public/alfresco/versions/1/nodes/node-id/children');
    curl_setopt($ch, CURLOPT_USERPWD,  'admin:password');  
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); 
    curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type:multipart/form-data'));
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);                                                                  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
    $result = curl_exec($ch);
    
    @@Result = $result;
} 
This trigger works and i have successfully uploaded files :) :)
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]