On 12 November 2010 18:21, Edson Tirelli <span dir="ltr">&lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    Wolfgang,<br>
<br>
   TypeDeclaration.getExpirationOffset() returns the value of the user<br>
defined expiration policy:<br>
<br>
@expires( 1h )<br></blockquote><div><br>OK...<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
   The final, inferred result is stored in the ObjectTypeNodes<br>
themselves, as it might be different for different entry points.<br>
<br></blockquote><div><br>There&#39;s no simple way to get at &#39;em, I suppose. So, as a user, how do I determine whether my current set of rules implies a finite expiry limit? If it isn&#39;t finite, I&#39;ll have to set an explicit @expires; if I do that, it could be too short...<br>
<br>Much along the lines I have carped in another thread: a &quot;clever&quot; system is allright, but it must not leave me in the dark about its cleverness.<br><br>Getting down to brass tacks: the stable API should provide access to any data<br>
<ul><li>set by the user or</li><li>determined by the compiler, and both<br></li><li>for Java types honed in by DRL declares as well as<br></li><li>for types declared in the DRL.</li></ul>Given all that, it might still be useful to have a way of turning the inferred expiry time off <b><i>without</i></b> setting an @expires for all types, which can be done with an @expires(1000000000d) or so).  Also, see that hint in a recent thread about how easy it is to implement a retraction strategy based on data in the events. One use case I was thinking of was with events (or even plain facts) having a variable duration attribute, to be retracted at timestamp+duration.<br>
<br>Wolfgang<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    Edson<br>
<br>
2010/11/12 Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; I have tried<br>
&gt;<br>
&gt; declare EventA<br>
&gt;   @role( event )<br>
&gt;   x : Void<br>
&gt; end<br>
&gt; declare EventB<br>
&gt;   @role( event )<br>
&gt;   x : Void<br>
&gt; end<br>
&gt; rule &quot;mock-A&quot;  # only rule for EventA, EventB<br>
&gt; when<br>
&gt;     $b: EventB()<br>
&gt;     $a: EventA( this after[0,10s] $b )<br>
&gt; then<br>
&gt; end<br>
&gt;<br>
&gt; and<br>
&gt;     org.drools.rule.TypeDeclaration tda =<br>
&gt; (org.drools.rule.TypeDeclaration)rpkg.pkg.getTypeDeclaration( &quot;EventA&quot; );<br>
&gt;     System.out.println( &quot;EventA expires: &quot; + tda.getExpirationOffset() + &quot;<br>
&gt; role:&quot; + tda.getRole());<br>
&gt;     org.drools.rule.TypeDeclaration tdb =<br>
&gt; (org.drools.rule.TypeDeclaration)rpkg.pkg.getTypeDeclaration( &quot;EventB&quot; );<br>
&gt;     System.out.println( &quot;EventB expires: &quot; + tdb.getExpirationOffset() + &quot;<br>
&gt; role:&quot; + tdb.getRole());<br>
&gt;<br>
&gt; which prints<br>
&gt;    EventA expires: -1 role:EVENT<br>
&gt;    EventB expires: -1 role:EVENT<br>
&gt;<br>
&gt; Since the DRL code is equivalent to example 2.19 (&quot;correlate orders&quot;) in<br>
&gt; Fusion, this raises the question whether the inferred expiration offset is<br>
&gt; actually computed as described.<br>
&gt;<br>
&gt; -W<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; rules-dev mailing list<br>
&gt; <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
  Edson Tirelli<br>
  JBoss Drools Core Development<br>
  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</blockquote></div><br>