<div> </div>
<div>Hi,</div>
<div> </div>
<div>In one-to-many relationship object type, Drools generate multiple results based on child objects data length. ie. No of child records<br>belongs to parent object. I wanted the RHS part should be executed only if conditions imposed<br>
on child object satisfies.</div>
<p>I have two facts with 1-* relationship defined in object mapping.</p>
<p>class Invoice{}</p>
<p>class Order{</p>
<p>private Set<Invoice> invoices;</p>
<p>}</p>
<p><strong>I wanted RHS should be executed with only one result irrespective of child records length.</strong></p>
<p>rule "Multiple results set"<br>when <br> <br> order: Order() <br> invoice : Invoice() from order.invoices<br> </p>
<p> then <br> <br> System.out.println("Rule Example (Multiple results set)"+order.getId());<br>end;</p>
<p>Result: <br> Rule Example (Multiple results set)1000<br> Rule Example (Multiple results set)1000</p>
<p><br>Please help me in resolving this issue.</p>
<p>Regards,<br>Riyaz</p>