Hi Stephen,<br><br>You&#39;ve made my afternoon ;)<br><br>The operation of &quot;otherwise&quot; is rather dumb. It does not have any understanding of what groups of rows it is meant to limit it&#39;s search of values to construct the &quot;not in....&quot; part.<br>
<br>As you have discovered, in your case, the Account column has no significance at all (to the web-guided decision table) although it does to the business analyst.<br><br>The immediate workaround would be to move each &quot;group&quot; to a different decision table; i.e. Account=1 and Account=2. I appreciate your example is probably a simplification of the real problem.<br>
<br>A better solution would be to furnish the &quot;otherwise&quot; value with the information it would need to determine it&#39;s search range. e.g. define &quot;otherwise&quot; with a key column of &quot;Account&quot;. This is however an enhancement :(<br>
<br>Feel free to raise a JIRA (for GUVNOR)... no promises as to when I&#39;ll get a chance to do anything about it though :( <br><br>More complex requirements exist, for example given:-<br><br><div style="font-family:courier new,monospace">
Account Qualifier Currency   CanTrade</div><div style="font-family:courier new,monospace">   1      A         EUR         Y</div><div style="font-family:courier new,monospace">   1      A         USD         Y</div><div style="font-family:courier new,monospace">
   1      B         IDR         Y</div><div style="font-family:courier new,monospace">   1      A       Otherwise     N</div><div style="font-family:courier new,monospace">   2      A         EUR         Y</div><div style="font-family:courier new,monospace">
   2      B         USD         Y</div><div style="font-family:courier new,monospace">   2      B       Otherwise     N</div><br style="font-family:courier new,monospace">Account=1, Qualifier=A, Otherwise = not in (&quot;EUR&quot;, &quot;USD&quot;)<br>
Account=1, Qualifier=B, There is no otherwise<br>
Account=2, Qualifier=A, There is no otherwise<br>Account=2, Qualifier=B, Otherwise = not in (&quot;USD&quot;) etc<br><br>So &quot;Otherwise&quot; will need a set of key\group columns.<br>

<br>With kind regards,<br><br>Mike<br><br>On 10 August 2012 15:50, Stephen Masters <span dir="ltr">&lt;<a href="mailto:stephen.masters@me.com" target="_blank">stephen.masters@me.com</a>&gt;</span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi folks,<div><br></div><div>Given a decision table a bit like this (hopefully the monospaced font lays it out ok!):</div>
<div><br></div><div><font face="&#39;Andale Mono&#39;">Account Currency CanTrade</font></div><div><font face="&#39;Andale Mono&#39;">   1       EUR       Y</font></div><div><font face="&#39;Andale Mono&#39;">   1       USD       Y</font></div>
<div><span style="font-family:&#39;Andale Mono&#39;">   1       IDR       Y</span></div><div><font face="&#39;Andale Mono&#39;">   1     Otherwise   N</font></div><div><font face="&#39;Andale Mono&#39;">   2       EUR       Y</font></div>
<div><font face="&#39;Andale Mono&#39;">   2       USD       Y</font></div><div><font face="&#39;Andale Mono&#39;">   2     Otherwise   N</font></div><div><font face="&#39;Andale Mono&#39;"><br></font></div><div>LHS conditions are generated a bit like this:</div>
<div><span style="white-space:pre-wrap">        </span>account == 1, currency == &#39;EUR&#39;</div><div><span style="white-space:pre-wrap">        </span>account == 1, currency == &#39;USD&#39;</div><div>        account == 1, currency == &#39;IDR&#39;</div>
<div><span style="white-space:pre-wrap">        </span>account == 1, currency not in (&#39;EUR&#39;, &#39;USD&#39;, &#39;IDR&#39;)</div><div><span style="white-space:pre-wrap">        </span>account == 2, currency == &#39;EUR&#39;</div>
<div><span style="white-space:pre-wrap">        </span>account == 2, currency == &#39;USD&#39;</div><div><span style="white-space:pre-wrap">        </span>account == 2, currency not in (&#39;EUR&#39;, &#39;USD&#39;, &#39;IDR&#39;)</div>
<div><br></div><div>… which has the effect that for account 2, currency IDR, the rule does not fire. For the business analysts building the rules, this does&#39;t make a lot of sense, as they&#39;re expecting it to mean:</div>
<div><span style="white-space:pre-wrap">        </span>account == 2, currency not in (&#39;EUR&#39;, &#39;USD&#39;)</div><div><br></div><div>Unfortunately this means that if a currency is permitted for one account, then a row must be added for every other account, indicating that the currency is not permitted.</div>
<div><br></div><div>I&#39;m trying to achieve a sensible default (fire the rule to reject the trade) unless the currency is explicitly permitted.</div><div><br></div><div>Is there a decent mechanism for achieving this in a decision table?</div>
<div><br></div><div>One alternative I can think of is to create a technical rule which logically inserts a rejection which exists as long as this rule hash&#39;t fired. But I would really prefer to avoid doing anything like that, as I reckon it would be something of a maintenance nightmare.</div>
<div><br></div><div>Any thoughts?</div><div><br></div><div>Cheers,</div><div><br></div><div>Steve</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>