I am new to Flowable and able to create a parallel multi instance task, in which users can give provide their feedback and approvals (Approve / Deny).
I am able to aggregate the response from each of the user in the task and can store it as array (response from each user).
Now based on response from each user, I want to create a flow where if anyone of the user Approve’s then would like to go to other flow or else directly close the case.
exlusive gateway with expression. In the expression you can use your custom bean method which will loop over results and returns true if at least one item is approved.
@martin.grofcik’s answer is correct: after the multi instance you’d need an exclusive gateway to route to the correct path. In this context, the variable aggregation also makes sense: Multi Instance Variable Aggregation
Custom beans are Java, so you’d need at least a basic understanding of creating and compiling a Java class … what’s your use case for it?
I have one process variable - ${reviewers} which is an array.
My First Task Initialize Variables take care of initializing this value.
Once this task Initialize Variables is marked as complete, based on number of reviewers (let say 10), I have created10 task for L1 team & 10 task for L2 team parallely (total 20). (Refer to given diagram)
Now Each of the task has one form associated that takes input (‘Approved’/‘Denied’).
After taking input from all the users (10 from L1 & 10 for L2), i.e total 20 inputs, I have stored it in process variable (let say “allReviewResult”) (which is again an array that has ‘Approved’/‘Denied’ from each user).
Now here comes the problem -
I have one inclusive gateway (circled in red) that waits for input from all users (20). Now I want to calculate if any of the users has given input as ‘Approved’, I would like to go to L3. Else if none of the users from 20 marked as ‘Approved’, I would like to close the case. (Please refer the attached diagram)
Currently I am stuck on how to calculate if any user is marked it as ‘Approved’ out of 20 users. Can I use for loop to go through “allReviewResult” variable and check ?