<div dir="ltr"><div><div>Yes it does fire if I comment either of them, and I get the exact same response. <br><br></div>I am using Drools 5.4.0.Final runtime.<br><br></div><div>Actually Products is the name property of an object of type DataObjectReference (wich implements ItemAwareElementAdapter). The point of providing the output was just to show you that the List&lt;ItemAwareElementAdapter&gt; returned by both getGivenResources() and getReceivedResources() is indeed not empty so the &quot;exists&quot; constraint should have been matched.<br>

</div><div><br></div>Thanks!<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 15, 2014 at 2:06 PM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">See inline.<br>
<div><div class="h5"><br>
On 15/06/2014, Poissy.B &lt;<a href="mailto:poissy.b@gmail.com">poissy.b@gmail.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I am a little bit confused as I don&#39;t get what I am doing wrong. Here is my<br>
&gt; rule:<br>
&gt;<br>
&gt; **************************<br>
&gt; rule &quot;Exchange Pattern&quot;<br>
&gt;     when<br>
&gt;         $p2: ProcessAdapter()<br>
&gt;         $mainProcess: ProcessAdapter( isMainProcess(), this!=$p2)<br>
&gt;         MessageFlowAdapter ( fromProcess == $mainProcess, toProcess==$p2)<br>
&gt;         MessageFlowAdapter ( fromProcess == $p2, toProcess==$mainProcess)<br>
&gt;         exists ItemAwareElementAdapter( ) from<br>
&gt; $mainProcess.getReceivedResources($p2)<br>
&gt;         exists ItemAwareElementAdapter( ) from<br>
&gt; $mainProcess.getGivenResources($p2)<br>
&gt;     then<br>
&gt;         System.out.println(&quot;** FOUND EXCHANGE PATTERN betwwen<br>
&gt; &quot;+$mainProcess.getParticipant().getName()+&quot; AND<br>
&gt; &quot;+$p2.getParticipant().getName());<br>
&gt;         System.out.println(&quot;Given:<br>
&gt; &quot;+$mainProcess.getGivenResources($p2)+$mainProcess.getGivenResources($p2).size());<br>
&gt;         System.out.println(&quot;Received:<br>
&gt; &quot;+$mainProcess.getReceivedResources($p2)+$mainProcess.getReceivedResources($p2).size());<br>
&gt;         System.out.println(&quot;Intersection:<br>
&gt; &quot;+$mainProcess.intersectGivenAndReceivedResourcesWithProcess($p2)+$mainProcess.intersectGivenAndReceivedResourcesWithProcess($p2).size());<br>
&gt; end<br>
&gt; **************************<br>
&gt;<br>
&gt; This rule is never fired, although I know it should.<br>
&gt;<br>
&gt; When I comment out the ONE OF the two &quot;exists&quot; constraints, I get this<br>
&gt; output:<br>
<br>
</div></div>Does the rule fire when you comment out either &quot;exists&quot; conditional element,<br>
i.e., it doesn&#39;t matter which one is removed?<br>
<br>
Which Drools version are you using?<br>
<br>
-W<br>
<div class=""><br>
&gt;<br>
&gt; **************************<br>
&gt; ** FOUND EXCHANGE PATTERN betwwen Amazon AND Ship.Comp.<br>
&gt; Given: [Products (ID:DataObjectReference_2)]1<br>
&gt; Received: [Products (ID:DataObjectRefeference_GEN7)]1<br>
&gt; Intersection: [Products (ID:DataObject_2)]1<br>
&gt; **************************<br>
<br>
</div>I can&#39;t say that a display of fact type &quot;Products&quot; is clearly indicating the<br>
presence of an ItemAwareElementAdapter. That said, the rule shouldn&#39;t<br>
fire even with a single &quot;exists&quot;, so I assume this is an interface implemented<br>
by Products.<br>
<div class=""><br>
&gt;<br>
&gt; &gt;From the output you can see that the rule should have been fired with the<br>
&gt; two &quot;exists&quot; constrains as both conditions are met, but it doesn&#39;t.<br>
&gt; I am kind of new to Drools so I may be doing an horrible mistake but google<br>
&gt; haven&#39;t been my friend so far. Any help will be very appreciated!<br>
&gt;<br>
&gt; Thanks.<br>
&gt; Anis<br>
&gt;<br>
</div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br></div>