It isn&#39;t duplicates but corrupted data coming off an vehicle. There is bug in the vehicle code that isn&#39;t zeroing out memory, or updating a time value during reset procedure which causes a bunch of facts to have the same end time stamp. We cannot really change the vehicle code because it was certified by the government and it is going to be a while before another one is certified. <br>
<br><br><br><div class="gmail_quote">On Sat, Feb 25, 2012 at 1:00 AM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Would you please define unambiguously what constitutes an &quot;invalid time&quot;?<br>
&gt;From your code it would appear that one time has to occur fivefold or<br>
more often to<br>
be &quot;invalid&quot;.<br>
<br>
In case any duplicates should be removed a simple high-priority rule<br>
is sufficient:<br>
<br>
rule killDuplicate<br>
salience 1000<br>
when<br>
   $f1: Fact()<br>
   $f2 :Fact( endTime == $f1.endTime )<br>
then<br>
  retract( $f2 );<br>
end<br>
<br>
-W<br>
<div><div class="h5"><br>
<br>
<br>
<br>
On 24/02/2012, Benjamin Bennett &lt;<a href="mailto:benbennett@gmail.com">benbennett@gmail.com</a>&gt; wrote:<br>
&gt; Trying to figure out if it can be done in a rule almost some sort of pre<br>
&gt; rule before other rules are triggered.<br>
&gt;<br>
&gt; The current rule I have is<br>
&gt;<br>
&gt; rule &quot;RemoveInvalidEndTimestamps&quot;<br>
&gt; salience 100<br>
&gt;<br>
&gt; when<br>
&gt;<br>
&gt; $factN : Fact()<br>
&gt; $factsToRemove : ArrayList(size&gt;=5)<br>
&gt;                  from collect( Fact(endTime==$factN.endTime))<br>
&gt; then<br>
&gt; List newFactsToRemove = new ArrayList();<br>
&gt; newFactsToRemove.addAll($factsToRemove);<br>
&gt; for(Fact n : newFactsToRemove ){<br>
&gt;  retract(n);<br>
&gt; }<br>
&gt; end<br>
&gt;<br>
&gt; I am using a cloud based process . I could sort the facts and stream them<br>
&gt; in.<br>
&gt; Just in a few test cases there are many facts with invalid times , which<br>
&gt; kills the speed .<br>
&gt; &gt;From the log I think that each collection of size&gt;=5 , is triggered which<br>
&gt; means triggered for 5,6,7, etc.<br>
&gt;<br>
&gt; Just wondering if there is way to say before doing any other rules collect<br>
&gt; up all these invalid times and remove them.<br>
&gt;<br>
&gt; I was just going to write up a some java code and filter before feeding<br>
&gt; facts into drools but I find the rule syntax is much easier to read for the<br>
&gt; non software developers in my group.<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Benjamin Bennett<br>
&gt;<br>
</div></div>&gt; &lt;<a href="mailto:benbennett@gmail.com">benbennett@gmail.com</a>&gt;<br>
&gt;<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>
</blockquote></div><br><br clear="all"><br>-- <br>Sincerely,<br><br>Benjamin Bennett<br>314.246.0645<br><a href="mailto:benbennett@gmail.com" target="_blank">benbennett@gmail.com</a><br><br>&quot;For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled.&quot;<br>
Richard Feynman<br>