drools - arraylist access wth multiple condition
<p>I have an object A which has list of Object B. </p>

<pre><code>Class A{
    List&lt;B&gt; bList;
}

Class B{
    String code;//Values QT1,QT2.....QT5
    Boolean answer;
}
</code></pre>

<p>B is like a questionnaire object. A hold all questionares, there will be always 5 questions (may get added in future) QT1 to QT5 with answer in true, false or null.
I need to fire a logic when for any QTx answer is null or QT1, QT2 is true. I have implemented as below but its not working. What is wrong with this?</p>

<pre><code>rule "validateQuestions"
ruleflow-group "validate"
dialect "mvel"
when
    $a : A(bList.empty == false)
    B(code == "QT1",answer == true) from $a.bList
    B(code == "QT2",answer == true) from $a.bList
    B(code == "QT3",answer == null) from $a.bList
    B(code == "QT4",answer == null) from $a.bList
    B(code == "QT5",answer == null) from $a.bList
then
    //("Logic Here")
</code></pre>

<p>There will always be 5 QTx and this can be any combination of answers with true false or null.</p>