[rules-users] Declaring an entry-point? (drools 5 M1)

Edson Tirelli tirelli at post.com
Mon Sep 1 22:30:01 EDT 2008


   You must explicitly constrain the pattern, if you don't want a cartesian
product.

   Following example may or may not help you:

https://svn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_CEP_TimeRelationalOperators.drl

   []s
   Edson

2008/9/1 Henry Canterburry <canterburry at gmail.com>

> Thanks Edson,
>
> Will try that out. One more question, when my pattern matches against
> the event, am I to assume the pattern matching in the order the events
> were placed or do I have to define additional matching statements on the
> pattern (i.e. comparing against a timestamp) to ensure I am matching
> against the most recent event?
>
> HC
>
> Edson Tirelli wrote:
> >
> >    Hello,
> >
> >    It seems you did everything correctly. It seems there is a parser
> > bug with the "" around the name of the entry point. For now, just
> > remove the " ", since your entry point is a single word. I will make
> > sure it gets fixed asap.
> >
> >    Also, a few more unit/integration tests you may want to look at:
> >
> >
> https://svn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/StreamsTest.java
> >
> https://svn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/CepEspTest.java
> >
> >   So, you are right to think that fact types are not tied to the
> > streams... just write "from entry-point" after any pattern to declare
> > what entry point that fact is coming from. Also, you can assert
> > regular facts to entry-points. Entry-points are a general abstraction,
> > whose probably the most known use case is for streams mapping, but not
> > the only one.
> >
> >    []s
> >    Edson
> >
> > 2008/9/1 H. Canterburry <canterburry at gmail.com
> > <mailto:canterburry at gmail.com>>
> >
> >     Hey, I am playing around with the new CEP features in 5 M1 and
> >     primarily working off of the blog posts and API doc. I have some
> >     patterns that pull from a stream:
> >
> >     $candle : Candle( $instrument :  instrumentSpecification ) from
> entry-point "candles"
> >
> >     I have my entry point in the WM:
> >
> >     candlesEntryPoint =
> this.session.getWorkingMemoryEntryPoint("candles");
> >
> >     I have also defined Candle to be an event in my rule.package file:
> >
> >     import org.test.Candle
> >
> >     declare Candle
> >       @role(event)
> >     end
> >
> >
> >     When I execute my sesson/getWorkingMemoryEntryPoint code above, I
> >     get a null back for the entry point and thus can't insert the
> >     event (Candle). The API docs for the getWorkingMemoryEntryPoint
> >     state that I need to define an entry point in the rules file? Is
> >     that the above part in the rule.package part or is that some other
> >     declaration? If that is a different declaration, is there some
> >     documentation what that would look like? The way I currently
> >     interpret the declare part is that I am designating my Candle
> >     object to be an event rather than a fact. Does that indirectly
> >     also declare an entry point? If so, how can I have heterogeneous
> >     streams with different object types? Thanks HC
> >
> ------------------------------------------------------------------------
> >     View this message in context: Declaring an entry-point? (drools 5
> >     M1)
> >     <
> http://www.nabble.com/Declaring-an-entry-point--%28drools-5-M1%29-tp19260204p19260204.html
> >
> >     Sent from the drools - user mailing list archive
> >     <http://www.nabble.com/drools---user-f11823.html> at Nabble.com.
> >
> >     _______________________________________________
> >     rules-users mailing list
> >     rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
> >     https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
> >
> >
> > --
> > Edson Tirelli
> > JBoss Drools Core Development
> > JBoss, a division of Red Hat @ www.jboss.com <http://www.jboss.com>
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Edson Tirelli
JBoss Drools Core Development
JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080901/c48c571b/attachment.html 


More information about the rules-users mailing list