On 12 November 2010 18:21, Edson Tirelli <span dir="ltr"><<a href="mailto:tirelli@post.com">tirelli@post.com</a>></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's no simple way to get at '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't finite, I'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 "clever" 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 <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>>:<br>
<div><div></div><div class="h5">> I have tried<br>
><br>
> declare EventA<br>
> @role( event )<br>
> x : Void<br>
> end<br>
> declare EventB<br>
> @role( event )<br>
> x : Void<br>
> end<br>
> rule "mock-A" # only rule for EventA, EventB<br>
> when<br>
> $b: EventB()<br>
> $a: EventA( this after[0,10s] $b )<br>
> then<br>
> end<br>
><br>
> and<br>
> org.drools.rule.TypeDeclaration tda =<br>
> (org.drools.rule.TypeDeclaration)rpkg.pkg.getTypeDeclaration( "EventA" );<br>
> System.out.println( "EventA expires: " + tda.getExpirationOffset() + "<br>
> role:" + tda.getRole());<br>
> org.drools.rule.TypeDeclaration tdb =<br>
> (org.drools.rule.TypeDeclaration)rpkg.pkg.getTypeDeclaration( "EventB" );<br>
> System.out.println( "EventB expires: " + tdb.getExpirationOffset() + "<br>
> role:" + tdb.getRole());<br>
><br>
> which prints<br>
> EventA expires: -1 role:EVENT<br>
> EventB expires: -1 role:EVENT<br>
><br>
> Since the DRL code is equivalent to example 2.19 ("correlate orders") in<br>
> Fusion, this raises the question whether the inferred expiration offset is<br>
> actually computed as described.<br>
><br>
> -W<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<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>
><br>
><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>