<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><base href="x-msg://2726/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Unless you are using fireUntilHalt there is now no longer any async reactivity. As discussed before, we have a stronger separation now between passive and reactive mode.<div><br></div><div>If you want to see what's happening, there is now a new trace debug information. You'll need a logback file similar to this, change the "info" to "trace":</div><div><a href="https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/resources/logback-test.xml">https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/resources/logback-test.xml</a></div><div><br></div><div>We have added an experimental feature that allows the user to provide explicit (rather than implicit) async reaction while in passive execution mode. Notice how it requires the user to provide a thread for this.</div><div><br></div><div>It has one too many unwrap pings to access, so we'll get that changed. But users will still need to cast to an internal interface, to show it's experimental. @mario: please make this a simple cast, instead of unwrapping. The other option is we could add it to the main interface, with javadoc caveats that it's api/signature will change - but i worry how many people will use the method, without reading the javadocs, and complain once we change it.</div><div><br></div><div>We will be looking to have more explicit and declarative control over async behaviour for 6.1</div><div><br></div><div><div style="border: 1px inset; padding: 2%; position: static; z-index: auto; "><pre style="margin-top: 0px; margin-bottom: 0px; padding: 6px; background-color: rgb(255, 255, 255); font-family: Menlo; font-size: 12px; position: static; z-index: auto; " bgcolor="#ffffff"><font color="#000080"><b>final </b></font><font color="#000000">BlockingQueue<TimedRuleExecution> queue = </font><font color="#000080"><b>new </b></font><font color="#000000">LinkedBlockingQueue<TimedRuleExecution>();
</font><font color="#000000">((StatefulKnowledgeSessionImpl)ksession).</font><font color="#660e7a"><b>session</b></font><font color="#000000">.setTimedExecutionsQueue(queue);
</font><font color="#000000">
</font><font color="#000080"><b>final </b></font><font color="#000000">AtomicBoolean run = </font><font color="#000080"><b>new </b></font><font color="#000000">AtomicBoolean(</font><font color="#000080"><b>true</b></font><font color="#000000">);
</font><font color="#000000">
</font><font color="#000000">Thread t = </font><font color="#000080"><b>new </b></font><font color="#000000">Thread(</font><font color="#000080"><b>new </b></font><font color="#000000">Runnable() {
</font><font color="#000000"> </font><font color="#000080"><b>public void </b></font><font color="#000000">run() {
</font><font color="#000000"> </font><font color="#000080"><b>try </b></font><font color="#000000">{
</font><font color="#000000"> </font><font color="#000080"><b>while </b></font><font color="#000000">(</font><font color="#660e7a">run</font><font color="#000000">.get()) {
</font><font color="#000000"> </font><font color="#660e7a">queue</font><font color="#000000">.take().evauateAndFireRule();</font><font color="#000000">
</font><font color="#000000"> }
</font><font color="#000000"> } </font><font color="#000080"><b>catch </b></font><font color="#000000">(InterruptedException e) {
</font><font color="#000000"> </font><font color="#000080"><b>throw new </b></font><font color="#000000">RuntimeException(e);
</font><font color="#000000"> }
</font><font color="#000000"> }
</font><font color="#000000">});
</font><font color="#000000">t.setDaemon(</font><font color="#000080"><b>true</b></font><font color="#000000">);
</font><font color="#000000">t.start();</font><br></pre></div><div><br></div></div><div><div><br></div><div><br><div><div>On 11 Sep 2013, at 14:16, "Weiss, Wolfgang" <<a href="mailto:Wolfgang.Weiss@joanneum.at">Wolfgang.Weiss@joanneum.at</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><font face="Calibri, sans-serif" size="2"><div>Hi all!</div><div> </div><div>I tried out Drools 6.0.0.CR3 and I have some difficulties in detecting patterns with rules containing temporal parameters. I’m using following rule:</div><div> </div><div><font face="Consolas, monospace" size="2" color="#960000"><b>rule</b><font><span class="Apple-converted-space"> </span></font><font color="#008000">"detect turn shifts"</font></font></div><div> <span class="Apple-converted-space"> </span><font face="Consolas, monospace" size="2" color="#960000"><b>agenda-group</b></font><font face="Consolas, monospace" size="2"><span class="Apple-converted-space"> </span></font><font face="Consolas, monospace" size="2" color="#008000">"evaluation"</font></div><div> <span class="Apple-converted-space"> </span><font face="Consolas, monospace" size="2" color="#960000"><b>salience</b></font><font face="Consolas, monospace" size="2"><span class="Apple-converted-space"> </span>100</font></div><div> </div><div><font face="Consolas, monospace" size="2"> <span class="Apple-converted-space"> </span><font color="#960000"><b>when</b></font></font></div><div><font face="Consolas, monospace" size="2"> $aae : AudioActivityEvent(value >= 50)<span class="Apple-converted-space"> </span><font color="#960000"><b>from</b></font><span class="Apple-converted-space"> </span>entry-point<span class="Apple-converted-space"> </span><font color="#008000">"LowLevelES"</font></font></div><div><font face="Consolas, monospace" size="2"> <span class="Apple-converted-space"> </span><font color="#960000"><b>not</b></font>(AudioActivityEvent(value < 50, userID == $aae.userID,<span class="Apple-converted-space"> </span><font color="#960000"><b>this</b></font><span class="Apple-converted-space"> </span>after[0, 300ms] $aae)<span class="Apple-converted-space"> </span><font color="#960000"><b>from</b></font><span class="Apple-converted-space"> </span>entry-point<span class="Apple-converted-space"> </span><font color="#008000">"LowLevelES"</font>)</font></div><div><font face="Consolas, monospace" size="2"> <span class="Apple-converted-space"> </span><font color="#960000"><b>then</b></font></font></div><div><font face="Consolas, monospace" size="2"> logger.info(<font color="#008000">"turn shift START, user ID: "</font><span class="Apple-converted-space"> </span>+ $aae.getUserID() +<span class="Apple-converted-space"> </span><font color="#008000">", "</font><span class="Apple-converted-space"> </span>+ $aae.toString());</font></div><div style="text-indent: 35pt; "><font face="Consolas, monospace" size="2" color="#808000">// do something else ...</font></div><div><font face="Consolas, monospace" size="2" color="#960000"><b>end</b></font></div><div> </div><div>When inserting events following happens:</div><div>12:43:05,914 [main ] DEBUG ReteooRuleBase - Starting Engine in PHREAK mode</div><div>12:43:06,225 [main ] INFO SemanticLifter - incoming event: AudioActivityEvent [userID=1, value=100.0]</div><div>12:43:06,295 [main ] INFO SemanticLifter - incoming event: AudioActivityEvent [userID=1, value=0.0]</div><div>12:43:06,344 [main ] INFO SemanticLifter - incoming event: AudioActivityEvent [userID=1, value=100.0]</div><div>12:43:11,096 [main ] INFO SemanticLifter - incoming event: AudioActivityEvent [userID=1, value=0.0]</div><div>12:43:11,100 [main ] INFO SemanticLifter - turn shift START, user ID: 1, AudioActivityEvent [userID=1, value=100.0]</div><div>...</div><div> </div><div>The “turn shift start” should be detected 300ms after the third incoming event (12:43:06,344) which is not the case here. This rule worked for me when using Drools 5.5.0 and 6.0.0.Beta2 but not with 6.0.0.CR3 - I did not try any other version.</div><div>This is my code to insert events:</div><div><font face="Consolas, monospace" size="2" color="#0000C0">streamEntryPoint<font><span class="Apple-converted-space"> </span>=<span class="Apple-converted-space"> </span></font>ksession<font>.getEntryPoint(</font><font color="#2A00FF">"LowLevelES"</font><font>);</font></font></div><div>...</div><div> </div><div><font face="Consolas, monospace" size="2" color="#0000C0">streamEntryPoint<font>.insert(lowLevelEvent);</font></font></div><div><font face="Consolas, monospace" size="2" color="#0000C0">ksession<font>.getAgenda().getAgendaGroup(</font><font color="#2A00FF">"evaluation"</font><font>).setFocus();</font></font></div><div><font face="Consolas, monospace" size="2" color="#0000C0">ksession<font>.fireAllRules();</font></font></div><div> </div><div>“AudioActivityEvent” is declared as an event with the @role attribute. I also tried to use the following option: “RuleEngineOption.RETEOO”, but with no difference.</div><div> </div><div> </div><div>Best regards,</div><div>Wolfgang</div><div> </div><div> </div></font>_______________________________________________<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">https://lists.jboss.org/mailman/listinfo/rules-users</a></div></blockquote></div><br></div></div></body></html>