<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:tahoma,new york,times,serif;font-size:10pt"><div>Greg,<br><br>Thanks for the example. This should do what I need. Can you point me to some documentation on how to create custom operators?<br><br>Earnie!<br></div><div style="font-family: tahoma,new york,times,serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Greg Barton &lt;greg_barton@yahoo.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> Rules Users List &lt;rules-users@lists.jboss.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Tue, June 22, 2010 4:29:50 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] Inter-fact comparison<br></font><br>
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">A regular old accumulate could do this.&nbsp; Doesn't even have to be custom:<br><br>rule "many bogus attempts"<br>when<br>$login : Login( $baseName : name)<br>$total : Number( intValue &gt; 5 )<br>from accumulate( Login( this != login, eval(levenshtein(name, baseName) ),<br>init( int total = 0; ),<br>action( total++; ),<br>reverse( total--; ),<br>result( total ) )<br>then<br>//ALARM!<br>end<br><br>This basically says "accumulate all Logins where the name is within a levenshtein distance of a given Login and freak out if there's more than X."<br><br>This rule isn't all fusiony, but you get the idea.&nbsp; Also, the eval in the accumulate could be a custom operator for readability.<br><br>--- On <b>Tue, 6/22/10, Earnest Dyke <i>&lt;earniedyke@yahoo.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px;
 padding-left: 5px;"><br>From: Earnest Dyke &lt;earniedyke@yahoo.com&gt;<br>Subject: Re: [rules-users] Inter-fact comparison<br>To: "Rules Users List" &lt;rules-users@lists.jboss.org&gt;<br>Date: Tuesday, June 22, 2010, 2:57 PM<br><br><div id="yiv362373790"><style type="text/css"><!--#yiv362373790 DIV {margin:0px;}--></style><div style="font-family: tahoma,new york,times,serif; font-size: 10pt;"><div>Thanks for the quick reply. <br><br>Yes, the original facts are already coming in via a stream (Fusion) to an existing set of rules so I was hoping to build on that. What I am trying to do is evaluate logins information as users are attempting to login trying to identify hack attempts by a person trying to login with a slightly different user name over a given period of time.<br><br>Earnie!<br></div><div style="font-family: tahoma,new york,times,serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size:
 12pt;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> David Sinclair &lt;dsinclair@chariotsolutions.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> Rules Users List
 &lt;rules-users@lists.jboss.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Tue, June 22, 2010 3:47:36 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] Inter-fact comparison<br></font><br>
Hi Earnie,<br><br>What you are explaining seems pretty straight forward and would more likely than not be overkill to use a rule engine. Are there other aspects of the system you are leaving out that warrant the use of Drools?<br>
<br>dave<br><br><div class="gmail_quote">2010/6/22 Earnest Dyke <span dir="ltr">&lt;<a rel="nofollow">earniedyke@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: tahoma,new york,times,serif; font-size: 10pt;">Greetings all,<br><br>I have a requirement to compare a set of facts against each other, calculate a value that indicates the amount of difference (Levenshtein distance) between a single attribute on each fact. So I load all of my facts into working memory then what? Do I execute a rule first that creates a new set of facts which is a Cartesian product of the original set of facts, each new fact containing a reference to two original facts and the diff between them? Looked at using a custom accumulate function but I don't think that's going to do what I need since it is intended to go through a set of facts and return a single value.<br>
<br>Any and all related help is appreciated.<br><br>Earnie! <br></div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a rel="nofollow">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>
</div></div>
</div></div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-users mailing list<br><a rel="nofollow">rules-users@lists.jboss.org</a><br><a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></div></blockquote></td></tr></tbody></table><br>

      </div></div>
</div></body></html>