Page 1 of 1

Two different users in a group need to perform two different tasks

Posted: Fri Oct 07, 2022 1:16 am
by MeenuSweety
Hi All, I'm new to process maker

Using the group users, I have a process maker to perform two different tasks. When the first task is completed by one user in the group, the 2nd task shouldn't be completed by the same user who performed the first task it should be a different user in the same group.

Example:
Group users - Tina, Hanna, Martha
'Tina' completed Task1 but Task2 shouldn't be completed by her, either Hanna or Maratha can do it in the same group.

Note: For Task2 I have kept Manual Assignment Manually selecting group users.

I would appreciate it if you could give me some ideas

Re: Two different users in a group need to perform two different tasks

Posted: Sat Oct 08, 2022 11:49 am
by MeenuSweety
Can anyone help me on this please.. Is there is way to handle this scenario.. To avoid same user which who perform pervious task shouldn't perform next task in same group user..

Re: Two different users in a group need to perform two different tasks

Posted: Thu Oct 13, 2022 11:11 pm
by Ironguts25
There is a way to handle this but I would call it more of a work around rather than a solution.

Using triggers, you can temporarily remove the user logged from the group after they submit the task and then they get added back into the group after the assignment is completed. i.e. the user will not show in the manual assignment list for the next task however they will be added back to the group once the assignment is complete so they can participate in future tasks under this group.

To do this you will need to create 2 triggers:

First trigger named Remove User From Group. Add the following code:
$aUser = PMFInformationUser(@@USER_LOGGED);//get information about the currently logged in user.
$groupName = "Your group name";//Enter the name of your group within the quotations
$g = new G();//new instance of Gulliver for message text
@@groupId = PMFGetGroupUID($groupName);//get ID of group name
if (empty(@@groupId)) {
$msg = "Group name '$groupName 'does not exist! User {$aUser['firstname']} {$aUser['lastname']} was not removed from the group for the next task.";
$g->SendMessageText($msg, "ERROR");// message added in case you got the group name wrong.
}
else {
@@result = PMFRemoveUsersFromGroup(@@groupId, array(@@USER_LOGGED));
$g->SendMessageText("User {$aUser['firstname']} {$aUser['lastname']} was removed from the group for the next task.", "INFO");
}

Second trigger named Add User To Group. Add the following code:
@@result = PMFAssignUserToGroup(@@USER_LOGGED, @@groupId);// restore user to group after assignment.

Then under the steps for task 1 drop trigger Remove User From Group to "Before Assignment" element. Then drop trigger Add User To Group to "After Routing" element.

That should do it. Let me know how it works :D

Re: Two different users in a group need to perform two different tasks

Posted: Wed Oct 26, 2022 7:45 am
by ljglmail
Your writing is really informative, especially because it's so meaningful and updated. Thanks for sharing this wonderful post!

Your writing is really great. I’m so glad I read it. It kept me hooked the whole way through.

Thanks for this information. I really appreciate the information that you have provided.

Re: Two different users in a group need to perform two different tasks

Posted: Mon Nov 14, 2022 10:35 pm
by salvatorenolan
Best work you have done, this online website is really cool with great facts.