Assuming TYPE_1 is the opposite of TYPE_2 and not just a difference it should work.<br><br>What is &quot;opposite&quot; is perhaps difficult to define as there is probably some semantics involved: up\down, left\right, yes\no. <br>
<br>These have well defined meanings and hence we can say with some certainty that these are opposites or one and other.<br><br><div class="gmail_quote">On 25 May 2012 14:07, Ben Cuthbert <span dir="ltr">&lt;<a href="mailto:bencuthbert@ymail.com" target="_blank">bencuthbert@ymail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">All<div><br></div><div>If I have an object say </div><div><br></div><div>class TestObject {</div>
<div><span style="white-space:pre-wrap">        </span>private String type;</div><div><span style="white-space:pre-wrap">        </span>private String name;</div><div>}</div><div><br></div><div>And I want to match opposite types so I fire in the following</div>
<div><br></div><div>insert(new TestObject(&quot;TYPE_1&quot;, &quot;This is our type 1 object&quot;);</div><div>insert(new TestObject(&quot;TYPE_2&quot;, &quot;This is our type 1 object&quot;);</div><div><br></div><div>So I want to say only match again opposite types</div>
<div><br></div><div>would this work?</div><div><br></div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">rule &quot;#999 Match&quot;</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">
<span style="white-space:pre-wrap">        </span>dialect &quot;<span style="text-decoration:underline">mvel</span>&quot;</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">
<span style="white-space:pre-wrap">        </span>when</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span><span style="white-space:pre-wrap">        </span>    $incoming : </span><span style="font-family:Helvetica;font-size:medium">TestObject</span><span>($type: type)</span></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span><span><span style="white-space:pre-wrap">        </span>    $current : </span><span style="font-family:Helvetica;font-size:medium">TestObject</span><span>(</span> </span>type<span> != $</span>type<span>)</span></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco"><span style="white-space:pre-wrap">        </span>then</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">
<span style="white-space:pre-wrap">        </span>    insert(new String(&quot;LOGGING: incoming:&quot; + $incoming.getT<span style="font-family:Helvetica;font-size:medium">ype</span>() + &quot; current:&quot; + $current.getType() ));</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 11px/normal Monaco">end</div></div><div><br></div></div><br>_______________________________________________<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>
<br></blockquote></div><br>