Need advise on modeling an usecase

Hello Experts, Need some advise on how to model an usecase we have got. I am sure you would have come across a case similar to this, wondering how you solved it.

Let’s say a process has to perform credit score on an application. Each application can have more than one applicant. For each applicant process has to calculate AgeScore & IncomeScore. At the end of the process we have to get an average of each applicant score. Any idea, what is the most elegant way to model something like this. Please see the attached screenshot to get a better idea of what I have in mind.

Thanks for your time.

Take a look at the pattern discussed in this thread: Pattern Review: DMN Looping for Array Input (make sure to review the entire thread as there are examples and notes further into the thread that update previous examples).

The pattern is to have the end of the sub-process update a Array/Collection/json array with each of the scores. Then in your script task you get the array and do your avg calculation.
The Array/Collection/json array lives in the parent process, and the sub-process is making a update to the parent process’ variable.