Hi Stephen,
You've made my afternoon ;)
The operation of "otherwise" is rather dumb. It does not have any understanding of what groups of rows it is meant to limit it's search of values to construct the "not in...." part.
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.
The immediate workaround would be to move each "group" to a different decision table; i.e. Account=1 and Account=2. I appreciate your example is probably a simplification of the real problem.
A better solution would be to furnish the "otherwise" value with the information it would need to determine it's search range. e.g. define "otherwise" with a key column of "Account". This is however an enhancement :(
Feel free to raise a JIRA (for GUVNOR)... no promises as to when I'll get a chance to do anything about it though :(
More complex requirements exist, for example given:-
Hi folks,Given a decision table a bit like this (hopefully the monospaced font lays it out ok!):Account Currency CanTrade1 EUR Y1 USD Y1 IDR Y1 Otherwise N2 EUR Y2 USD Y2 Otherwise NLHS conditions are generated a bit like this:account == 1, currency == 'EUR'account == 1, currency == 'USD'account == 1, currency == 'IDR'account == 1, currency not in ('EUR', 'USD', 'IDR')account == 2, currency == 'EUR'account == 2, currency == 'USD'account == 2, currency not in ('EUR', 'USD', 'IDR')… which has the effect that for account 2, currency IDR, the rule does not fire. For the business analysts building the rules, this does't make a lot of sense, as they're expecting it to mean:account == 2, currency not in ('EUR', 'USD')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.I'm trying to achieve a sensible default (fire the rule to reject the trade) unless the currency is explicitly permitted.Is there a decent mechanism for achieving this in a decision table?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't fired. But I would really prefer to avoid doing anything like that, as I reckon it would be something of a maintenance nightmare.Any thoughts?Cheers,Steve
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users