- Fri Nov 04, 2011 5:53 pm
#16195
Hi people,
I just installed PM and I'm struggling with triggers and the @@SYS_NEXT_USER_TO_BE_ASSIGNED system variable.
First of all: Is @@SYS_NEXT_USER_TO_BE_ASSIGNED really a system variable? And I ask this because here (http://wiki.processmaker.com/index.php/ ... n_Triggers) you can't see it listed. Given the amount of references to @@SYS_NEXT_USER_TO_BE_ASSIGNED I'm assuming it exists.
I have 3 tasks and after the 1st one I move to the 2nd which has a simple dynaform which contains a Radio Button and based on its selection I want to set the @@SYS_NEXT_USER_TO_BE_ASSIGNED to the original issuer of the case (supposedly store in @@USER_LOGGED) or the only user to which task 3 is assigned.
I have added a trigger to the process and also added to task 2 under Steps Of -> Triggers -> Assign task -> Before Assignment, with no conditions
I have tested the SQL and it's returning the correct values.
Debug is not helping me at all. I don't see the trigger... I get the error saying @@SYS_NEXT_USER_TO_BE_ASSIGNED has no value or does not exist.
PLEASE HELP! Thanks!
The trigger is:
if (@@Action == 'Reject')
@@SYS_NEXT_USER_TO_BE_ASSIGNED = @@USER_LOGGED;
else
{
$aTasks = executeQuery("SELECT CON_ID FROM CONTENT WHERE CON_VALUE='Approve TS (RD)'");
$taskId = $aTasks[1]['CON_ID'];
//look up all the assigned users to the the task in the database
$aUsers = executeQuery("SELECT USR_UID FROM TASK_USER WHERE TAS_UID='$taskId' AND TU_TYPE='1'");
//get USR_UID of the RD which is the only user of the assigned to the 'Approve TS (RD)' task
@@SYS_NEXT_USER_TO_BE_ASSIGNED = $aUsers[1]['USR_UID'];
}
I just installed PM and I'm struggling with triggers and the @@SYS_NEXT_USER_TO_BE_ASSIGNED system variable.
First of all: Is @@SYS_NEXT_USER_TO_BE_ASSIGNED really a system variable? And I ask this because here (http://wiki.processmaker.com/index.php/ ... n_Triggers) you can't see it listed. Given the amount of references to @@SYS_NEXT_USER_TO_BE_ASSIGNED I'm assuming it exists.
I have 3 tasks and after the 1st one I move to the 2nd which has a simple dynaform which contains a Radio Button and based on its selection I want to set the @@SYS_NEXT_USER_TO_BE_ASSIGNED to the original issuer of the case (supposedly store in @@USER_LOGGED) or the only user to which task 3 is assigned.
I have added a trigger to the process and also added to task 2 under Steps Of -> Triggers -> Assign task -> Before Assignment, with no conditions
I have tested the SQL and it's returning the correct values.
Debug is not helping me at all. I don't see the trigger... I get the error saying @@SYS_NEXT_USER_TO_BE_ASSIGNED has no value or does not exist.
PLEASE HELP! Thanks!
The trigger is:
if (@@Action == 'Reject')
@@SYS_NEXT_USER_TO_BE_ASSIGNED = @@USER_LOGGED;
else
{
$aTasks = executeQuery("SELECT CON_ID FROM CONTENT WHERE CON_VALUE='Approve TS (RD)'");
$taskId = $aTasks[1]['CON_ID'];
//look up all the assigned users to the the task in the database
$aUsers = executeQuery("SELECT USR_UID FROM TASK_USER WHERE TAS_UID='$taskId' AND TU_TYPE='1'");
//get USR_UID of the RD which is the only user of the assigned to the 'Approve TS (RD)' task
@@SYS_NEXT_USER_TO_BE_ASSIGNED = $aUsers[1]['USR_UID'];
}