Anybody?<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <span class="gmail_sendername">Damien Renier</span><br><br><p class="MsoNormal">All,</p>

<p class="MsoNormal">I’m trying to prepare some answers to questions of a
customer</p>

<p class="MsoNormal">The client wish to execute some rules on dates which are
not today.</p>

<p class="MsoNormal"><br></p><p class="MsoNormal">The rule is:</p>

<table border="0" cellpadding="0">
 <tbody><tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">1.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:red">rule</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"> <span style="color:green">&quot;TooYoung&quot;</span></span></p>

  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">2.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">    <span style="color:red">date-expires</span> <span style="color:green">&quot;26-MAR-2013&quot;</span></span></p>

  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">3.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">    <span style="color:red">date-effective</span> <span style="color:green">&quot;19-MAR-2010&quot;</span></span></p>

  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">4.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">    <span style="color:red">dialect</span> <span style="color:green">&quot;mvel&quot;</span></span></p>

  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">5.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">    <span style="color:red">when</span></span></p>

  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">6.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">        Driver(
  age &lt; <span style="color:green">&quot;16&quot;</span> )</span></p>
  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">7.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">    <span style="color:red">then</span></span></p>

  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">8.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">        Rejection
  fact0 = new Rejection();</span></p>
  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">9.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">        fact0.setReason( <span style="color:green">&quot;TooYoung&quot;</span> );</span></p>

  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">10.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">        insert(fact0
  );</span></p>
  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">11.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">        System.out.println(<span style="color:green">&quot;TooYoung&quot;</span>);</span></p>

  </td>
 </tr>
 <tr>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:gray">12.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:green">|</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
  <td style="padding:0cm 0cm 0cm 0cm">
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:red">end</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"></span></p>

  </td>
 </tr>
</tbody></table>

<p class="MsoNormal"> </p>

<p class="MsoNormal">First test with execution date set to today in Guvnor/test-scenario</p>

<p class="MsoNormal">Rule is executed - OK</p>

<p class="MsoNormal"><br></p><p class="MsoNormal">Second test with execution date set to tomorrow</p>

<p class="MsoNormal">Rule is executed – OK</p>

<p class="MsoNormal"><br></p><p class="MsoNormal">Now one change the rule’s attributes and execution date</p>

<p class="MsoNormal"><span lang="FR">Execution date =
20-MAR-2011</span></p>

<p class="MsoNormal"><span lang="FR">date-effective =
19-MAR-2010</span></p>

<p class="MsoNormal"><span lang="FR">date-expires<span>   </span>= 26-MAR-2011</span></p>

<p class="MsoNormal"><span lang="FR">no execution</span></p>

<p class="MsoNormal"><br></p><p class="MsoNormal">Execution date = 20-MAR-2012</p>

<p class="MsoNormal">date-effective = 19-MAR-2012</p>

<p class="MsoNormal">date-expires<span>   </span>=
26-MAR-2013</p>

<p class="MsoNormal">no execution</p>

<p class="MsoNormal"><br></p><p class="MsoNormal">So my guess is the execution date is ignored.</p>

<p class="MsoNormal">I tried to use the AgendaFilter unsuccessfully.</p>

<p class="MsoNormal">ksession.fireAllRules(new AgendaFilter() {</p>

<p class="MsoNormal"><span>                </span>public
boolean accept(Activation a) {</p>

<p class="MsoNormal"><span>                </span><span>                </span>System.out.println(&quot;--
&quot; + a.getRule().getName());</p>

<p class="MsoNormal"><span>                </span><span>                </span>return true;</p>

<p class="MsoNormal"><span>                </span>}</p>

<p class="MsoNormal">});</p>

<p class="MsoNormal"><br></p><p class="MsoNormal">But this code do not work for the specific rule above,
others with no date attributes are going through and the sysout do its job.</p>

<p class="MsoNormal"><br></p><p class="MsoNormal">My question is:</p>

<p class="MsoNormal">How can I tell the engine which rule to execute based on the
execution date? Maybe this behaviour is only in Guvnor.<br>
Is it possible to set an execution date to the engine which is not today and
how to do it?</p>

<p class="MsoNormal"><br></p><p class="MsoNormal">Thank you</p><p class="MsoNormal"><br></p>

<p class="MsoNormal">Damien</p><div><div></div><br></div></div>