[rules-dev] Inferred expiration offset: does it really work?

Edson Tirelli tirelli at post.com
Fri Nov 12 12:21:01 EST 2010


    Wolfgang,

   TypeDeclaration.getExpirationOffset() returns the value of the user
defined expiration policy:

@expires( 1h )

   The final, inferred result is stored in the ObjectTypeNodes
themselves, as it might be different for different entry points.

    Edson

2010/11/12 Wolfgang Laun <wolfgang.laun at gmail.com>:
> I have tried
>
> declare EventA
>   @role( event )
>   x : Void
> end
> declare EventB
>   @role( event )
>   x : Void
> end
> rule "mock-A"  # only rule for EventA, EventB
> when
>     $b: EventB()
>     $a: EventA( this after[0,10s] $b )
> then
> end
>
> and
>     org.drools.rule.TypeDeclaration tda =
> (org.drools.rule.TypeDeclaration)rpkg.pkg.getTypeDeclaration( "EventA" );
>     System.out.println( "EventA expires: " + tda.getExpirationOffset() + "
> role:" + tda.getRole());
>     org.drools.rule.TypeDeclaration tdb =
> (org.drools.rule.TypeDeclaration)rpkg.pkg.getTypeDeclaration( "EventB" );
>     System.out.println( "EventB expires: " + tdb.getExpirationOffset() + "
> role:" + tdb.getRole());
>
> which prints
>    EventA expires: -1 role:EVENT
>    EventB expires: -1 role:EVENT
>
> Since the DRL code is equivalent to example 2.19 ("correlate orders") in
> Fusion, this raises the question whether the inferred expiration offset is
> actually computed as described.
>
> -W
>
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com



More information about the rules-dev mailing list