For loop to Evaluate Condition

Hi Team,

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.

This is how the Modeler app looks -

Could you please help on how I can loop on the aggregated response array and define the condition expression for the same.

Thanks in advance!

Hi Ishan,

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.

Regards
Martin

Hi Martin,

Thanks for your response.

I am using Flowable Open Source, and using Flowable’s Rest API to start case & complete task etc from my Node App.

Is it still possible to use Custom Bean method somehow? or are there any alternatives?

PS - I don’t have JAVA background

Thanks,
Ishan

@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?

Hi @joram / @martin.grofcik ,

Here is my use case -

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 ?

Hope my question is clear.

Thanks,
Ishan