cancel
Showing results for 
Search instead for 
Did you mean: 

SCP Workflow UserTask Multiple Recipients

06-05-2020 1:18 AM
chrisnguyen Explorer
1623 views 4 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

I have a requirement where in some cases, if a UserTask has multiple recipients, the task needs to have all recipients approve the task before moving on to the next evaluation. It looks like currently, as soon as the first approver actions the task, the workflow proceeds to the next step.

I have tried, as a simple test, splitting to two separate UserTask components with the parallel gateway split/join setup and with this setup, once both task are actioned, the join step and subsequent steps are never reached. Even if this worked, it is not ideal since there may be N number of approvers for each step.

The SAP documentation on how this is handled is very sparse and I have searched through many blogs and Q&A to no avail.

Is this possible with SCP Workflows? If not, a suggested enhancement would be to have a checkbox or toggle on the UserTask details that specify that the UserTask is complete upon one approval or all approvals.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Archana
Product and Topic Expert
Product and Topic Expert

Hello Chris,
There are multiple ways to achieve this:

  • If you want to send a task to multiple users for approval, and want to move forward only when all of them have either approved/rejected the user task, then you use parallel gateway.
  • You can have all these users as recipients of the task. As until all your users complete the task, you do not want to complete it, then you need to code the complete button appropriately. Store the responses from the recipients, and until all of them have completed or responded, do not complete the task.

Hope that helps.

chrisnguyen
Explorer

Hi Archana,

Thank you for your suggestion. This gives me an alternate idea. My thought is instead of using parallel gateway, since I can have an unknown number of approvers in parallel, I will have all the approvers in a single user task. The complete button, which can we code in a custom UI will handle the completion of the single workflow instance once all appovers have approved or immediately exit upon the first rejection. The key here is the approve/reject buttons will have the necessary logic to decide whether to complete the task or keep it open.

Answers (1)

Answers (1)

nikolai_spogahn
Explorer

Dear Chris,

you need multi-instance tasks which are unfortunately not available yet. (Multi-instance) referenced subprocesses are also not available in SCP Workflows yet. So, we have to implement multi-instance tasks by our own with the available BPMN palett as a workaround. That means

  • Outsource the task to an own process. It should consist at least of a human task followed by a service task that notifies the calling process on completion
  • Call that task process dynamically within a loop for each task instance by using a service task
  • Collect all answers within another loop by using intermediate message events

It's a bit complicated but we successfully implemented it in our projects and it is working fine - except that monitoring is not that easy in the default monitoring app that comes out of the box because there is no direct relation from the parent process to the task processes. Nevertheless, I do not see another possibilty to implement such behaviour in SCP Workflows yet.

Kind regards

Niko

chrisnguyen
Explorer
0 Likes

Nikolai,

Thanks for taking the time to respond to my question. Based on your suggestion and Archana's suggestion, I think I have a way forward that will simplify the workflow design and allow me to do N number of concurrent approvers at each step. The heavy lifting will be done by the custom UI that is used to approve/reject as we can keep the task open until all approvers action the task. We can track the approvers either in the context or a separate datastore and check after each approver clicks the button if there are any remaining approvers before completing the task. If any approver rejects, we can immediately perform the necessary actions to terminate the WF. This approach should simplify your design as well since the WF will be self contained.