Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By devbhanu
#823406
Hi ,
I have script task where it gets assigned managers based on the values in dynaform. I have a gateway condition to next task. If @@req = new goes to manager or @@req == change to review. Assigning case to manager . how can i assign a case to review where the mail is provided in the form if we select change.

Thanks in advance.
User avatar
By amosbatto
#823413
devbhanu wrote:I have script task where it gets assigned managers based on the values in dynaform. I have a gateway condition to next task. If @@req = new goes to manager or @@req == change to review. Assigning case to manager . how can i assign a case to review where the mail is provided in the form if we select change.
Let's say that you have the following process:
processWithGatewayToSelectManager.png
processWithGatewayToSelectManager.png (18.96 KiB) Viewed 44 times


If you have set up Departments, and the user assigned to "Task 1" is a member of a department, then "Task 2" can use Reports To Assignment to assign the task to the user's manager. The gateway condition to go to "Task 2" would be:
@@req == 'new'
Make sure that the user's manager is in the assignment list for "Task 2".

"Task 3" can use cyclical assignment (or Value Based Assignment if you want to specify the assigned user with a variable set in a trigger) and its gateway condition would be:
@@req == 'change'

In your process, create the following email template with the filename "reviewIssue":
Code: Select all
@#editableEmail 
Then, create a Dynaform with a textarea whose variable is "editableEmail", which will be displayed in "Task 3".

Then, create the following trigger which is fired before the Dynaform to set the default text for the email:
Code: Select all
//get the name of a user:
$aUser = userInfo(@@USER_LOGGED):
$fullName = $aUser['firstname'].' '.$aUser['lastname'];

//variables from the case to insert in the email's text:
$reporter = @@reporterName; 
$issue = @@issueDescription;

@@editableEmail = "<p>Dear $fullName,</p>
<p>Please review the following issue filed by $reporter :</p>
<p>$issue</p>
<p>Sincerely,<br>
The management</p>";
Finally, create another trigger to fire after the Dynaform which has the following code:
Code: Select all
if (!empty(@@editableEmail)) {
   $aUser  = userInfo(@@USER_LOGGED);
   $to = $aUser['mail'];
   PMFSendMessage(@@APPLICATION, "[email protected]", $to, '', '', "Review case #"[email protected]@APP_NUMBER, 
      'reviewIssue.html', array('editableEmail'=>@@editableEmail));
}
Read the documentation for PMFSendMessage().
By devbhanu
#823453
Thank you Amos for your answer.
Can we give link to case in the Email to unknown who is not a user in the process maker?
So that he can access the case with SSO and enter details of the form and submit.

Thank you for your Help!
User avatar
By amosbatto
#823457
devbhanu wrote: Tue Mar 19, 2019 5:56 pm Can we give link to case in the Email to unknown who is not a user in the process maker?
So that he can access the case with SSO and enter details of the form and submit.
If you want to provide a link to the case in the email, you can add this line to your email template:
Code: Select all
Case: http://example.com/[email protected]#SYS_SYS/@#SYS_LANG/@#SYS_SKIN/cases/opencase/@#APPLICATION
If the user doesn't have an open login session, then the web browser will redirect to a login screen. After login, the browser will redirect back to the case. You can import users from LDAP or Active Directory, so the user can use the same password to login to ProcessMaker as his other services. However, if you want Single Sign On, then you will need ProcessMaker Enterprise Edition.

By the way, PM 3.3.4 Community Edition and later has a bug and can't import of users from LDAP and Active Directory. I just discovered it today:
viewtopic.php?f=40&t=736492

Post the code of your requests.Request work. You m[…]

Hi, seems like I am not allowed to log into proces[…]

Thanks for the reply :P

No, This answer was not working because I need the[…]