Hello,
I would suggest that instead of taking 12 grids, one for each month, you should take text field which should be read-only and will be auto filled with the current month using a trigger.
Taking 12 grids will increase the processing time of your process and reduce its efficiency because, for checking the current month before routing to the next task, we will have to use a switch case with 12 cases and it will make the process really slow.
To achieve your first target i.e., plan should reach the corresponding users, you can do the following:
1. If you want the task for different users to run in parallel, you should fix the maximum number of parallel tasks before designing the process.
2. In the task Tour Plan create a dynaform similar to yours but with only one grid and one text field(for month).
3. In the process after the task Tour Plan, use an
Inclusive Gateway which will point to different user tasks.(refer the attached image)
4. All the tasks attached to this gateway will be having
Value Based Assignment. These tasks will work in parallel and will next go to a same or different task according to your requirement.
5. Also, you should save the values of the grid into database(a PM Table). A PM Table say PMT_PLAN which will have an auto incrementing ID as the primary key and other fields as: USER, DATE, DEST. This will reduce the redundancy that will be caused in the parallel tasks.
6. Now, create the following trigger :
Code: Select all$aUsers = @=gridVar001;
@%noMembers = count($aUsers);
if (@%noMembers >= 1)
@@userForTask1 = $aUsers[1]['user'];
if (@%noMembers >= 2)
@@userForTask2 = $aUsers[2]['user'];
if (@%noMembers >= 3)
@@userForTask3 = $aUsers[3]['user'];
if (@%noMembers >= 4)
@@userForTask4 = $aUsers[4]['user'];
for($i = 1; $i <= @%noMembers; $i++){
$query = "INSERT INTO PMT_PLAN (USER , DATE, DEST) VALUES ('$aUsers[$i]['user']','$aUsers[$i]['pdate']','$aUsers[$i]['dest']')";
$result = executeQuery($query);
}
}
The trigger will get the USR_UID of all the users who have been assigned a plan and store them in variables so as be used for the value based assignment of the next task.
7. For the next set of tasks(parallel tasks) create a dynaform and a trigger which will fetch the details of the plan for the logged in user and assign it to the fields in the dynaform.
8. The trigger and dynaform can now be same for all the tasks.
Trigger to be used here can be as follows:
Code: Select all$query = "SELECT * FROM PMT_PLAN WHERE USER = @@USER_LOGGED";
$result = executeQuery($query);
@@user_date = $result[1]['DATE'];
@@user_dest = $result[1]['DEST'];
where @@user_date and @@user_dest are the variables for fields in the dynaform for the user task.
Please execute the above codes and let me know if this serves your requirements.
Hope this helps.
Best Regards
Mishika