<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<ItemAwareElementAdapter> returned by both getGivenResources() and getReceivedResources() is indeed not empty so the "exists" 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"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>></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 <<a href="mailto:poissy.b@gmail.com">poissy.b@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> I am a little bit confused as I don't get what I am doing wrong. Here is my<br>
> rule:<br>
><br>
> **************************<br>
> rule "Exchange Pattern"<br>
> when<br>
> $p2: ProcessAdapter()<br>
> $mainProcess: ProcessAdapter( isMainProcess(), this!=$p2)<br>
> MessageFlowAdapter ( fromProcess == $mainProcess, toProcess==$p2)<br>
> MessageFlowAdapter ( fromProcess == $p2, toProcess==$mainProcess)<br>
> exists ItemAwareElementAdapter( ) from<br>
> $mainProcess.getReceivedResources($p2)<br>
> exists ItemAwareElementAdapter( ) from<br>
> $mainProcess.getGivenResources($p2)<br>
> then<br>
> System.out.println("** FOUND EXCHANGE PATTERN betwwen<br>
> "+$mainProcess.getParticipant().getName()+" AND<br>
> "+$p2.getParticipant().getName());<br>
> System.out.println("Given:<br>
> "+$mainProcess.getGivenResources($p2)+$mainProcess.getGivenResources($p2).size());<br>
> System.out.println("Received:<br>
> "+$mainProcess.getReceivedResources($p2)+$mainProcess.getReceivedResources($p2).size());<br>
> System.out.println("Intersection:<br>
> "+$mainProcess.intersectGivenAndReceivedResourcesWithProcess($p2)+$mainProcess.intersectGivenAndReceivedResourcesWithProcess($p2).size());<br>
> end<br>
> **************************<br>
><br>
> This rule is never fired, although I know it should.<br>
><br>
> When I comment out the ONE OF the two "exists" constraints, I get this<br>
> output:<br>
<br>
</div></div>Does the rule fire when you comment out either "exists" conditional element,<br>
i.e., it doesn't matter which one is removed?<br>
<br>
Which Drools version are you using?<br>
<br>
-W<br>
<div class=""><br>
><br>
> **************************<br>
> ** FOUND EXCHANGE PATTERN betwwen Amazon AND Ship.Comp.<br>
> Given: [Products (ID:DataObjectReference_2)]1<br>
> Received: [Products (ID:DataObjectRefeference_GEN7)]1<br>
> Intersection: [Products (ID:DataObject_2)]1<br>
> **************************<br>
<br>
</div>I can't say that a display of fact type "Products" is clearly indicating the<br>
presence of an ItemAwareElementAdapter. That said, the rule shouldn't<br>
fire even with a single "exists", so I assume this is an interface implemented<br>
by Products.<br>
<div class=""><br>
><br>
> >From the output you can see that the rule should have been fired with the<br>
> two "exists" constrains as both conditions are met, but it doesn't.<br>
> I am kind of new to Drools so I may be doing an horrible mistake but google<br>
> haven't been my friend so far. Any help will be very appreciated!<br>
><br>
> Thanks.<br>
> Anis<br>
><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>