<div dir="ltr"><div><div><div><div><div><div><div>Hello, <br><br></div>I am a little bit confused as I don't get what I am doing wrong. Here is my 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 $mainProcess.getReceivedResources($p2)<br> exists ItemAwareElementAdapter( ) from $mainProcess.getGivenResources($p2) <br> then<br> System.out.println("** FOUND EXCHANGE PATTERN betwwen "+$mainProcess.getParticipant().getName()+" AND "+$p2.getParticipant().getName());<br>
System.out.println("Given: "+$mainProcess.getGivenResources($p2)+$mainProcess.getGivenResources($p2).size());<br> System.out.println("Received: "+$mainProcess.getReceivedResources($p2)+$mainProcess.getReceivedResources($p2).size());<br>
System.out.println("Intersection: "+$mainProcess.intersectGivenAndReceivedResourcesWithProcess($p2)+$mainProcess.intersectGivenAndReceivedResourcesWithProcess($p2).size());<br>end<br>**************************<br>
<br></div>This rule is never fired, although I know it should. <br><br></div>When I comment out the ONE OF the two "exists" constraints, I get this output: <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>From the output you can see that the rule should have been fired with the two "exists" constrains as both conditions are met, but it doesn't. <br>
</div>I am kind of new to Drools so I may be doing an horrible mistake but google haven't been my friend so far. Any help will be very appreciated!<br><br></div>Thanks. <br></div>Anis<br></div>