This quick tip is from a question posted in the community about how to create a process where I have 10 potential approvers for the process. At the start of the process the trigger indicates which approvers are needed, and all the approvers are asked in parallel with a branch. For each branch, here are the possibilities:
The obvious way to do it is to have a branch activity, and in each branch to have a condition to either automatically "approve" or require the approver to complete an approval form. The problem is, you cannot have a condition inside a branch.
First, here's the project: https://github.com/sap-tutorials/sap-build-apps/blob/main/projects/spa-parallel-dyanmic-approval/Con...
I created a generic subprocess that can be used multiple times for each department that needs approval. First, I created input, outputs and variables:
I then created a very simple process, where I check if the approval is needed.
We also add a decision step to set the custom variable to true. We go to this decision step if he approval form is approved, or if no approval is needed.
Finally, in the end step, we set the output to the value of the custom variable.
For the main process, I created a Boolean input for each department that may or may not need to approve the process, as well as an email address. For this test, I used the same email address – mine – to be the approver. I could have created a separate email input for each department, as well as for the text to put at the top of each approval form.
Then I created the process in 2 parts: The first is a branch for each department, and for each branch I put an instance of the subprocess.
I bound each of the process boolean inputs to the "approval needed" boolean input for the corresponding subprocess. I also bound the email input to each of he subprocess email inputs.
That's it.
After all he approval steps are complete, the process goes to a condition, which checks all the outputs of he subprocesses, and returns the appropriate response if the entire process was approved or not. You could also have other scenarios where it checks that you have a certain number of approvals, or any other scenario you want.
Remember to set the condition editor to require all the conditions to be true.
It's not so great that you cannot differentiate between he "approval" output value of the various subprocess instances in the condition above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |