'SpEL - Test multiple conditions in findAll

I am writing a SpEL condition. It should be a basic IF, THEN, ELSE condition. Currently it is this way:

cus_FinalCostBoolean == true ? FormDetails.findAll{cus_ForceRecommended == true}.min{cus_LastNegotiationRound} : FormDetails.findAll{cus_ForceRecommended == false}.min{cus_LastNegotiationRound}

where: cus_FinalCostBoolean is a boolean variable cus_ForceRecommended is a boolean variable cus_LastNegotiationRound is a decimal number

Currently what this condition does is the following: IF cus_FinalCostBoolean IS TRUE THEN calculate min(cus_LastNegotiationRound) among all the entries that have cus_ForceRecommended = TRUE ELSE calculate min(cus_LastNegotiationRound) among all the entries that have cus_ForceRecommended = FALSE

I'd like editing it the following way: IF cus_FinalCostBoolean IS TRUE THEN calculate min(cus_LastNegotiationRound) among all the entries that have cus_ForceRecommended = TRUE and cus_TechnicalEvaluationPassed = 'OK' ELSE calculate min(cus_LastNegotiationRound) among all the entries that have cus_ForceRecommended = FALSE and cus_LastNegotiationRound is not null

where cus_TechnicalEvaluationPassed is a text variable

I was trying to editing it this way:

cus_FinalCostBoolean == true ? FormDetails.findAll{cus_ForceRecommended == true && cus_TechnicalEvaluationPassed == 'OK'}.min{cus_LastNegotiationRound} : FormDetails.findAll{cus_ForceRecommended == false && cus_LastNegotiationRound != null}.min{cus_LastNegotiationRound}

But it seems it does not work. Could you help me?

Thank you. Best regards.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source