Interval-based events must have a property for their duration (in ms), not the end time.<br><br>@duration(duration)<br>duration : long<br><br>-W<br><br><div class="gmail_quote">2011/7/22 Neelesh Deo Dani <span dir="ltr">&lt;<a href="mailto:neeleshdev@yahoo.co.in">neeleshdev@yahoo.co.in</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;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
Hi,<br>
I&#39;ve following event declarations and rule:<br>
<br>
declare Event <br>
    @role(event) <br>
    @timestamp(datetime)<br>
    datetime : Date<br>
    name : String<br>
end<br>
<br>
declare Contest<br>
    @role(event)<br>
    @timestamp (startTimestamp)<br>
    startTimestamp : Date<br>
    endTimestamp : Date<br>
end<br>
<br>
rule &quot;Contest&quot;<br>
no-loop<br>
when    <br>
    $e : Event(name == &quot;event1&quot;)<br>
    $contest : Contest(this includes $e)<br>
then <br>
    System.out.println(&quot;rule Contest fired&quot;);<br>
end<br>
<br>
The timestamps with Event and Contest objects are set as follows (before insert in state-full session):<br>
<br>
           // for Contest object<br>
           Calendar c = Calendar.getInstance();<br>
            c.set(2011, 7, 1);<br>
            contestType.set(contest, &quot;startTimestamp&quot;, new Date(c.getTimeInMillis()));<br>
            c.set(2011, 7, 31);<br>
            contestType.set(contest, &quot;endTimestamp&quot;, new Date(c.getTimeInMillis()));<br>
<br>
            // for Event object<br>
             c.set(2011, 7, 3);<br>
             eventType.set(event, &quot;datetime&quot;, new Date(c.getTimeInMillis()));<br>
<br>
The condition &quot;this includes $e&quot; in LHS doesn&#39;t get evaluated to true and RHS doesn&#39;t get executed.<br>
<br>
If I change it to &quot;$contest.startTimestamp before $e, 
$contest.endTimestamp after $e&quot;  which has the same meaning then it 
works fine.<br>
Please help in resolving the issue.<br>
<br>
Thanks &amp; Regards,<br><font color="#888888">
Neelesh<br>
<br>
<br>
</font></td></tr></tbody></table><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>
<br></blockquote></div><br>