<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
on a related note I do plan to add OTHERWISE support at a DRL level,
just no time to do it right now. Once it's supported at a DRL level,
you won't need to as much work on figuring out the inverse options
etc.<br>
<br>
Mark<br>
On 31/03/2011 20:25, Michael Anstis wrote:
<blockquote
cite="mid:AANLkTikbMOpabWvxyk_p2N_v8WKhx_gPCiqJ8m_udN5H@mail.gmail.com"
type="cite">Hi,<br>
<br>
I'm adding support for "otherwise" to (for the time being) the
guided decision table in Guvnor.<br>
<br>
The idea being if you set a cell to represent "otherwise" the
generated rule is the opposite of the accumulation of the other
cells; perhaps best explained with an example:-<br>
<br>
<div style="margin-left: 40px;"><span style="font-family: courier
new,monospace;">Person( name == )</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Mark</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Kris</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Geoffrey</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"><otherwise></span><br
style="font-family: courier new,monospace;">
</div>
<br>
This would generate:-<br>
<br>
<span style="font-family: courier new,monospace;">Person(name not
in ("Mark", "Kris", "Geoffrey")</span><br style="font-family:
courier new,monospace;">
<br>
Equals is the simple example, this is my thoughts for the other
operators we might like to support:-<br>
<ul>
<li>!= becomes "in (<list of the other cells' values)"</li>
<li>< becomes ">= the maximum value of the other cells'
values</li>
</ul>
<br>
<div style="margin-left: 40px;">For example:-<br>
<br>
<span style="font-family: courier new,monospace;">Person ( age
< )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">10</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">20</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">30</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"><otherwise></span><br
style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Person ( age
>= 30 )</span></div>
<br>
<ul>
<li><= becomes "> the maximum value of the other cells'
values</li>
<li>> becomes "<= the minimum value of the other cells'
values</li>
<li>>= becomes "< the minimum value of the other cells'
values</li>
<li>"in" becomes "not in (<a list of all values contained in
all the other cells' lists of values>)"</li>
</ul>
<div style="margin-left: 40px;">For example:-<br>
</div>
<br>
<div style="margin-left: 40px;">
<span style="font-family: courier new,monospace;">Person ( name
in )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Jim, Jack</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Lisa, Jane,
Paul</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"><otherwise></span><br
style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Person ( name
not in ("Jim", "Jack", "Lisa", "Jane", "Paul" ) )</span><br>
<br>
</div>
<ul>
<li>I'm not sure there is a simple solution for "matches" and
"soundslike" but welcome advice, although a possibility might
be to create a compound field constraint:-<br>
</li>
</ul>
<div style="margin-left: 40px;">
<span style="font-family: courier new,monospace;">Person ( name
soundslike )</span><br style="font-family: courier
new,monospace;">
<span style="font-family: courier new,monospace;">Fred</span><br
style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Phil</span><br
style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">not Person (
name soundslike "Fred" || soundslike "Phil" )</span><br
style="font-family: courier new,monospace;">
</div>
<br>
<br>
Would this be considered the most suitable approach?<br>
<br>
Inputs and thoughts welcome.<br>
<br>
Thanks,<br>
<br>
Mike <br>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>