I define the registry process as follows: 1- User submit request. 2- Admin check request. If request needs editing, two tasks will raise, “Edit Request by User” and “Approve/Reject by Admin” (second task is used because user may not continue so that admin could finish the process).
If one of the tasks is completed, the other task should be canceled and only one path of execution continued. How can I do that? Now if User complete “Edit Request by User” task, the “Approve/Reject by Admin” remains active (two paths of executions)
You could attach a task listener to the tasks and programmatically complete the other task. For instance when Task A completes you can attach a listener to the complete event of Task A and then complete Tsk B. And vice versa.
You can attach an interrupting boundary conditional event to both tasks and define the condition based on a flag variable to be updated once any of the tasks get completed.
What I meant is to set the flag to true once any of the tasks get completed so the boundary event of the other task gets triggered which in turn ends the pending task.
Output parameter approach can be used to set flag variable to true (assuming flag variable is available on process level)
or TaskListener approach (attached to task completion event) can be used to set the flag variable to true.
Edit: the working example can work without the “Initialize flag to false” task but “Variable Events” of conditional boundary events should be changed to involve “create” event as in below snip