Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By atuly7
#790235
Hello,

I used following code for generating output document.
Code: Select all
$outDocId = '96578979458995b9f6afb04041036087';
$caseId = @@APPLICATION;

PMFGenerateOutputDocument($outDocId);


$query = "SELECT APP_DOC_UID FROM APP_DOCUMENT WHERE APP_UID='$caseId' AND 
   DOC_UID='$outDocId' AND APP_DOC_STATUS='ACTIVE'"; 
$result = executeQuery($query);
  
if (!is_array($result) or count($result) == 0) {
   die("Error: Unable to find generated Output Document in database.");
}
  
$d = new AppDocument();
$aFile = $d->Load( $result[1]['APP_DOC_UID'] );


@@outDocUrl = 'http://' . $_SERVER['SERVER_NAME'] .
    //':' . $_SERVER['SERVER_PORT'] . 
   '/sys'. @@SYS_SYS . '/en/neoclassic/cases/cases_ShowOutputDocument?a=' . 
   $aFile['APP_DOC_UID'] . '&v='. $aFile['DOC_VERSION'] . '&ext=pdf'; 
@@outDocFilename = $aFile['APP_DOC_FILENAME'] .'_'. $aFile['DOC_VERSION'] .'.pdf';
In my process, there are 3 task. task1->task2->task3.
Above code generates output document. Task1 raised a case, task2 approved it then task3 approved case. When case is approved by task3 it is completed and In participated case of task3 can see generated document, but task1 can't see it How to solve this problem?

Thanks & Regards
By zainab
#790240
Hello atuly7,

In which task is this trigger assigned, that is in which task is the output document being generated?

Also, how are you trying to see the output document in Task 1, could you please elaborate your scenario.

Could you please attach your process here, so that I can have a look at it.

Looking forward to your response.

Best Regards,
Zainab Sabunwala
By atuly7
#790243
zainab wrote:Hello atuly7,

In which task is this trigger assigned, that is in which task is the output document being generated?

Also, how are you trying to see the output document in Task 1, could you please elaborate your scenario.

Could you please attach your process here, so that I can have a look at it.

Looking forward to your response.

Best Regards,
Zainab Sabunwala
This trigger is assigned in all task. Because I want to update output document with each task user's comment. This is assigned after routing.
In task1 , I am going to participated case-> click on summary->Generated document.
Here is my Process Downloads.zip
viewtopic.php?f=41&t=710032

Thanks & Regards
By zainab
#790244
Hello atuly7,

When your case is in Task 1, the document is being generated after routing, that is when in Task1 the document yet hasn't been created. If after completing Task1, when you go to Participated Cases, the case will be in Task2, now if you see the Generated Documents you will be able to see your document. But when you are in Task1, and you have yet not completed the task1, the status of the case will be Draft, now when you go to the Participated cases, and view the Generated Document for that case in Task1, it won't be visible because it hasn't been created yet.

What you can do is set the trigger to fire after Dynaform in Task1, after submitting the Dynaform, when you go to the Participated cases, you will find your document under Generated documents.

Please let me know if this solution helps, and this is what you were trying to do.

Best Regards,
Zainab Sabunwala
By atuly7
#790259
zainab wrote:Hello atuly7,

When your case is in Task 1, the document is being generated after routing, that is when in Task1 the document yet hasn't been created. If after completing Task1, when you go to Participated Cases, the case will be in Task2, now if you see the Generated Documents you will be able to see your document. But when you are in Task1, and you have yet not completed the task1, the status of the case will be Draft, now when you go to the Participated cases, and view the Generated Document for that case in Task1, it won't be visible because it hasn't been created yet.

What you can do is set the trigger to fire after Dynaform in Task1, after submitting the Dynaform, when you go to the Participated cases, you will find your document under Generated documents.

Please let me know if this solution helps, and this is what you were trying to do.

Best Regards,
Zainab Sabunwala
Nope. It's not working. In my process, there are 3 task(task1,task2 and task3). Task1 raised case. Task2 and Task3 are approvers of that case. When Task1 raised a case and submit it then task1 user can see generated document. When case is approved by task2 user then he can see generated document. But at that time task1 user can't see generated document of that case. When case is approved by task3 user then he can see generated document. But at that time task1 and task2 users can't see generated document of that case. In all task, I fired that trigger after dynaform and in output document comment of users recorded. but I got generated document in task3 only when task3 user is final user and he approved or rejected that case.

One more thing task1 and task2 users comment's are not updated in output document. When they checked generated document. Unlike task3 user.

Thanks & Regards
By zainab
#790265
Hello,

The reason user of Task1 is not able to view the document generated in Task2 is because he does not have the permission to view the document. You need to allow the user to view the documents generated throughout the case in all the tasks otherwise a user will only be able to view the documents generated in a task which he participated in. In order to define Permissions, open your process in Designer and in the Main toolbox you will see an option Permissions, click on that and define permissions for all the users and group to allow access. Please have a look at the attached screenshot for reference.
permission.png
permission.png (23.48 KiB) Viewed 3943 times
Also refer to the below documentation link for step by step knowledge:
http://wiki.processmaker.com/3.1/Process_Permissions

The reason comments weren't update in Task1 and Task2, because they do not have access to the updated document generated in Task3.

Hope this helps.

Best Regards,
Zainab Sabunwala
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[…]