I have some problems checking if an object of a list has a value with drools.
My model is this
class Products{
private List<Approver> approvalPath;
}
class Approver{
private String employeeName;
}
So, I need to make a rule like this
rule "member"
when
//approvalPath has an approver with name "Charles" (for example)
then
//do something
end
How can I do it?
Here are two versions.
when
$app: Approver( employeeName == "Charles" )
Products( approvalPath contains $pp )
And:
when
Products( $ap: approvalPath )
Approver( employeeName == "Charles" ) from $ap
Number 1 requires the insertion of Approver objects as facts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With