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