I have one object of class "Applicant"
Applicant applicant = new Applicant("David", 37); // (name, experienceInYears)
Based on age of applicant, I am setting its role:
SuggestedRole suggestedRole = new SuggestedRole();
applicantService.suggestARoleForApplicant(applicant, suggestedRole);
My drool file is:
rule "Suggest Manager Role"
when
Applicant(experienceInYears > 10)
then
suggestedRole.setRole("Manager");
end
From: https://www.baeldung.com/drools
What I want to achieve is to perform same operation for List[Applicant]. One way is to iterate over list in Java and do same, but I am looking for drool solution. Is there anyway I can just configure drool to take List[Applicant] as input and return List[SuggestedRole]