<div>&nbsp;</div>
<div>Hi,</div>
<div>&nbsp;</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&lt;Invoice&gt; invoices;</p>
<p>}</p>
<p><strong>I wanted RHS should be executed with only one result&nbsp; irrespective of child records length.</strong></p>
<p>rule &quot;Multiple results set&quot;<br>when <br>&nbsp; <br>&nbsp;&nbsp;&nbsp; order: Order() <br>&nbsp;&nbsp;&nbsp; invoice : Invoice() from order.invoices<br>&nbsp;&nbsp; </p>
<p>&nbsp; then <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; System.out.println(&quot;Rule Example (Multiple results set)&quot;+order.getId());<br>end;</p>
<p>Result: <br>&nbsp;Rule Example (Multiple results set)1000<br>&nbsp;Rule Example (Multiple results set)1000</p>
<p><br>Please help me in resolving this issue.</p>
<p>Regards,<br>Riyaz</p>