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.
#824004
The type of assignment used by a task is set in the process map, so it can't be changed when running cases.

A task can use a Parallel Marker, so that it can be assigned to multiple users at the same time, but remember that each assigned user will overwrite the variables in the case, so you need to store the variables set by the user in an array (such as a grid) if you want to be able to recover those variables later.

You can use Set Variables: PUT /cases/{app_uid}/variable to send the assignment variable to the case before it gets to the task with the parallel marker.

There are other ways to assign a case to multiple users. See:
https://wiki.processmaker.com/3.2/Trigg ... r_of_Times

If you want to reassign a task that is already assigned to a user, then you can install my extraRest plugin and then use this REST endpoint:
https://www.pmusers.com/index.php?title ... ssign-case
#824023
kalinovski wrote: Tue Apr 16, 2019 4:18 am I need to reassign the task to an array of users.
These users are not members of any group.
They are selected dynamically from a list.

So is there a way to reassign the case to them via a PHP script?
If you have a checkgroup or a multiple select dropdown box, then you can populate the list of users with this SQL query of the ProcessMaker database:
SELECT USR_UID, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME) FROM USERS;
Then, the user can select the users to assign to the task.

If your PHP script is outside ProcessMaker, then you will need to use the REST endpoint PUT /cases/{app_uid}/variable or the sendVariables() web service to send the array of user IDs to the case. Then you can use one of the three methods that I explained in the previous post to assign the task to multiple users (Parallel Marker in one task, parallel tasks or serially with loop in process).
#824028
Basically, I'm trying to 'self service value based assign' an array of users to a task, then if no one claim's the case after a certain amount of time passes, a trigger reassigns the task to another array of users.

Your methods are designed for assigning the task to one certain user. I need it to be reassigned to an array of people. And all of the reassignment has to happen in the background by a trigger, without user manipulation.
#824037
I think you should write 1 API:
- Get out the pending cases
- claim case to inbox of the specified user
write a job periodically after an API call period

or even a risky way:
insert data into the table app_assign_self_service_value_group
- ID: ID of the table app_assign_self_service_value
- GRP_UID: ID of the special user
-> I am not happy with this way
#824039
kalinovski wrote: Wed Apr 17, 2019 2:53 am Basically, I'm trying to 'self service value based assign' an array of users to a task, then if no one claim's the case after a certain amount of time passes, a trigger reassigns the task to another array of users.

Your methods are designed for assigning the task to one certain user. I need it to be reassigned to an array of people. And all of the reassignment has to happen in the background by a trigger, without user manipulation.
This is complicated. Give a day or two to create a programming example for you at pmusers.com.

Here is the summary:
You need your Self Service Value Based Assignment task to have a loop-around with an exclusive gateway. Then, you need to create a separate process with a script task in a loop with an intermediate timer event that checks whether a certain amount has passed in the other process with the Self Service Value Based Assignment task. If too much time has passed, then use Cases::setCatchUser() to assign a user to the user, then use PMFSendVariable() to change the list of users in the array variable and then PMFDerivateCase() to route the case through the loop so it will start gain at the same task with a new set of users.

If this doesn't make any sense to you, then wait for me to write up a programming example.

The basic idea of an external timer is explained here:
https://www.pmusers.com/index.php/Send_ ... is_overdue

PS: Next time clearly explain what you want in your first post, so you don't waste people's time trying to guess what you want.

By the way, if you want to place your custom log[…]

process reset itself

Hj, I have the same problem. There's any problem[…]

HI, I am using processmaker-3.3.6-1 version and I […]

Link to new dynaform

I couldn’t refrain from commenting. Very wel[…]