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.
By fromero
#5599
Hello! I just started testing PM, and so far has been a very good tool. I have a question however:

I am modeling a company-wide request system, and whenever a request is received by the head of one the departments, he has to assign the task resolution to the users that work on HIS department only. Is there a way to limit the user list on the assignment based on a user profile value?

Thanks in advance,

Francisco Romero
User avatar
By amosbatto
#5628
What you can do is assign everyone in each department to groups. Then design your process like this:

Make a process map like this:

Task1
|
Task2
/ | \
Accounting HR Sales

Task1 - chooses which department the case will route to.
Task2 - This task is assigned to a group which contains all the department supervisors. The case will be handled by a particular supervisor of a department. Make this task a manual assignment, so that supervisor can choose which employee in his department will next handle the case before routing the case to the particular department.
By fromero
#5638
Hum, Could be... But we have 30 departments! And the task to be performed is basically the same for each user... That means having 30 tasks that are basically the same task... maintaining that when the task changes or a department is created/eliminated will be difficult.

is there any what that a derivation can be "department-aware"? I.e. Taking the logged user USER_ID and limiting the list of users available to be assigned the next task?

Regards,

FJR
User avatar
By amosbatto
#5647
OK, here is a solution. Assign the employees to groups for each department. In the first task, display a DynaForm with a dropdown box named "SelectDepartment" to choose the department. To populate this dropdown box, use an SQL Statement like:
SELECT CON_ID, CON_VALUE FROM CONTENT WHERE CON_CATEGORY='GRP_TITLE' AND CON_LANG='en'

In the second task, display a DynaForm with a dropdown box named "SelectNextUser", where the supervisor for the department can select a user from his department. For this dropdown box, use an SQL Statement like:

SELECT U.USR_UID, CONCAT(U.USR_FIRSTNAME, ' ', U.USR_LASTNAME, ' (', USR_USERNAME, ')')
FROM USERS U, GROUP_USER GU
WHERE GU.GRP_UID=@@SelectDepartment AND GU.USR_UID=U.USR_UID

The third task will be assigned to the user selected in the dropdown box "SelectNextUser". To do this, assign the third task to all the employees in your organization, then right click on the third task in the process map and select the option "Properties" from the dropdown menu. Go to the "Assignment Rules" tab and select "Value Based Assignment" and enter the variable: "@@SelectNextUser".
By fromero
#6205
Worked out fine!

it would be nice to have a way to reflect company/institution organization hierarchy on the users, and have a table/view to easy access it.

Kudos,

FJR
By JMather
#6234
Just to expound, I wanted to provide a little more detail here into something I did that was quite similar.

We have 110 what we will call, departments, here.

Each department has 3-4 people in them.

Each department is assigned to one staff for activity A, and one staff for activity B, however there are multiple staff members who perform A and B (i.e. Staff 1 will do A for dept 1 through 30, Staff 2 will do A for dept 31 through 60).

We had a couple requirements:

1) Dept members can only create requests for their department

2) Staff can create requests for any department

3) Whoever made the request should get all 'confirmation' steps.


So we made 110 groups, Department 1 through Department 110.

Then we assigned Dept members to their respective department group.

Then we assigned activity A and activity B staff to their respective groups (i.e. 1-3, 31-60, so on and so forth).


Request creation:

We created a trigger that detects the user's USR_ROLE, and sets @@IS_DEPT_STAFF dependent upon the role set.

We created two initial dynaforms. One has a department dropdown, one doesn't. Condition's applied, when IS_DEPT_STAFF==1 we show no dropdown, otherwise we do.

Then we have 3 more important triggers that run post-dynaform.

Assign To Activity A Handler
Assign To Activity B Handler
Assign To Case Creator


The activity handlers look up the defined department that we stored in a case variable (think: @@DEPT_ID), then look for someone who has role ACTIVITY_A and is in group Dept <num>.


This allowed us to automate and hide a lot of the selection systems.

Just though I would share the process behind how I accomplished a similar, though I believe cleaner, solution.
By fromero
#6270
Nice! we already did some work kinda forcing the bar for the groups and having a director's group, but having a hierarchy that can be embedded into the users would be the best overall solution, I think. The natural representation of the company organization.
By jeffreytan
#6853
Hi, im having a similar project as well

is the code working?
i did the 1st step but this 2nd step doesnt display anything, i got the 2 dropdown list in a same dynaform.
Code: Select all
SELECT U.USR_UID, CONCAT(U.USR_FIRSTNAME, ' ', U.USR_LASTNAME, ' (', USR_USERNAME, ')') 
FROM USERS U, GROUP_USER GU 
WHERE GU.GRP_UID =@@SelectDepartment AND GU.USR_UID=U.USR_UID
The 2nd dropdown list is empty when i choose the department in the first dropdown list.

Thanks for the help

Use the latest verified Temu coupon $100 off ([acq[…]

To get $100 off, sign up as a new user using refer[…]

To get $100 off, sign up as a new user using refer[…]

To get $100 off, sign up as a new user using refer[…]