Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
#782822
Hi all, the case is as follows:

I have a workflow with parallel tasks (attachment image).

The initial task has a grid which the user searches for N directors, each row is a director (attachment image).

The idea is that in the parallel tasks are being assigned the first 4 directors selected in the grid. Ie depending on the value of the grid, these managers will be assigned to each task.

What I've done is create a trigger for each task in parallel, which run Before

With the following code:
Code: Select all
#allocation of the first row of the grid a variable containing the name
$nombre_director1 = @=grdDirectores['1']['txtDirector'];


#sql query to extract the UUID of charge from its name
$query = "SELECT USR_UID FROM  USERS
      WHERE concat(USR_FIRSTNAME  ,' ', USR_LASTNAME  )  = '".$nombre_director1."'";   
      
$result = executeQuery($query);
$id_director = $result[1]['USR_UID'];

#UID assignment to the variable that contains the user who is assigned to task
@@SYS_NEXT_USER_TO_BE_ASSIGNED = $id_director;
I do a trigger different for each parallel task and only change the row number in the line:
Code: Select all
$nombre_director1 = @=grdDirectores['1']['txtDirector'];
But when you run the WF, and move to the parallel tasks, i get an error that says the tasks do not have assigned users.

Please, I need guidance to dynamically assign users to tasks in parallel ...

regards
Attachments
mix.jpg
Process and DynaForm
mix.jpg (77.52 KiB) Viewed 4053 times
#782885
Hi lmherrera,

What Task Designation Rule are you trying to use for your "dynamic user assignments"? You can use either "Value Based Assignment" or "Manual Selection" in this situation.

As I can see in your process, you can select "Value Based Assignment" for the parallel tasks (Task2, Task3, Task4 and Task5), using case variables which you defined such as @@userTask2 , @@userTask3, etc. Then define the value of @@userTask2 and @@userTask3 in your trigger.Take in account that your trigger has to be set BEFORE the tasks 2,3,4 and 5 not on the [ASSIGN TASK]

By the way, if you want to change the user with a trigger inside of Task2, Task3, etc , you can do this by logging in with web services as a user who has the PM_REASSIGNCASE permission in his/her Role and then calling the reassignCase() web service. You can also do it manually by logging in to ProcessMaker as that user and using the menus to reassign the case.

Regards.
Last edited by LennyVelasco1 on Mon Apr 27, 2015 4:20 pm, edited 1 time in total.
#782887
Hi LennyVelasco1, I kind of solved the problem as you suggest.

Part of the problem was that I was not using the "Value Based Assignment". I also created the trigger to define the case variables, but i had to assign it "before routing" in Task1, I tried to assign it in every task, "before" but it didnt work.

I appreciate your help.. Thanks...

Regards

To take Cenforce 120mg tablet, follow the guidelin[…]

ICO software script is a pre-made program for crea[…]

A crypto exchange script is a pre-designed softwar[…]

So I recently bought an addmotor Ebike which of co[…]