Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
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.
#798813
Dear All,

Am working on a process which is exactly same like email.

Process contains only two tasks. Compose mail task and Read mail task (Parallel Marker Type Task and which value based assignment with Array type variable is).

DynaForm contains only two fields Subject & Body (for testing purpose only later I will have more fields).

The scenario is like this. User A starts new case (Compose mail task) and selects the users to be assigned (Example User B, C & D) to the next task (Read Mail task). Trigger will fire before assignment and sets the selected user ids in an array variable which will be used to assign next task.
All the 3 users (B, C & D) received tasks and shows in their respective inboxes. Now User C opens the task from Inbox and selects 2 users (E & F) to send.

Here is the issue. When the new tasks created for Users E & F other all previous tasks (For User B & D) which were still in inboxes are getting deleted.

I have attached my process. Please suggest a solution to fix it. If this issue is not resolved then I have to look for an alternative BPM solution which is a very big change for me.

Thanks & Regards
Jaheer
Attachments
E_Mail_System.PNG
E_Mail_System.PNG (9.09 KiB) Viewed 3227 times
(53.47 KiB) Downloaded 310 times
#798821
You can route on all the rest of the parallel tasks to prevent them from being executed.

Here is a trigger that you can execute in the parallel task by the first user who opens the task:
Code: Select all
$taskId = @@TASK; 
$caseId = @@APPLICATION;
$index  = @%INDEX;

$sql = "SELECT * FROM APP_DELEGATION WHERE APP_UID='$caseId' AND TAS_UID='$taskId' AND 
  DEL_THREAD_STATUS='OPEN' AND DEL_INDEX<>$index";
$aTasks = executeQuery($sql);


if (!is_array($aTasks)) {
    throw new Exception("Unable to query APP_DELEGATION table");
}
$g = new G();

foreach ($aTasks as $aTask) {
   $g->sessionVarSave();
   PMFDerivateCase($aTask['APP_UID'], $aTask['DEL_INDEX'], true, $aTask['USR_UID']); 
   $g->sessionVarRestore();    
}  


I have added a second process to show you how to use this trigger:
(90.14 KiB) Downloaded 383 times
#798873
Jaheer, I can't apply the code to your process, because your process doesn't have a way to select the users to assign to the "Read Email" task. Are you using the members of a group, the members of a department, a checkgroup, a grid, or some other way to select the users?

Are you looking for a more intelligent approach to[…]

The 1Win Clone Script is a pre-built solution that[…]

Aviator Clone Script replicates the renowned Aviat[…]

From converting physical assets into digital asset[…]