<p>Thank-you</p>
<div class="gmail_quote">09-08-2011 13:23 użytkownik &quot;Wolfgang Laun-2 [via Drools]&quot; &lt;<a href="/user/SendEmail.jtp?type=node&node=3243602&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt; napisał:<br type="attribution">
&gt; <br>&gt; <br>&gt; Modules (=agenda-group and ruleflow-group) are fine for large-scale<br>&gt; rule flow control. First choice for fine-grained rule execution<br>&gt; control is - Logic.<br>&gt; <br>&gt; Write your constraints so that only one rule fires, e.g., by testing<br>
&gt; price == null.<br>&gt; <br>&gt; Ideally, you should also avoid salience by fully describing the cases<br>&gt; for prices 1 and 2.<br>&gt; <br>&gt; Using flow control and salience - this isn&#39;t rule based programming<br>
&gt; any more, just a very elaborate way of implementing sequential logic.<br>&gt; <br>&gt; -W<br>&gt; <br>&gt; <br>&gt; <br>&gt; On 9 August 2011 13:08, bitter &lt;<a href="/user/SendEmail.jtp?type=node&node=3243602&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt; wrote:<br>
&gt;&gt; But when I use activation-group only one fact has price. I would like to<br>&gt;&gt; insert two facts (or more) and only one rule invoke per fact.Like in my test<br>&gt;&gt; class.<br>&gt;&gt; Could you look at use case that I attached in my first post? Thanks.<br>
&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; Wolfgang Laun-2 wrote:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; You should use activation-group &quot;price&quot; or similar, not lock-on-active.<br>&gt;&gt;&gt; -W<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 9 August 2011 11:40, Wolfgang Laun &amp;<a href="/user/SendEmail.jtp?type=node&node=3243602&i=2" target="_top" rel="nofollow" link="external">[hidden email]</a>&amp;gt;<br>&gt;&gt;&gt; wrote:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; &quot;Whenever a ruleflow-group becomes active [...], any rule within that<br>
&gt;&gt;&gt;&gt; group that has lock-on-active set to true will not be activated any<br>&gt;&gt;&gt;&gt; more.&quot; (Emphasis added by me.)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Do you activate the ruleflow-group before you insert the Car fact?<br>
&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; -W<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; On 9 August 2011 11:05, bitter &amp;<a href="/user/SendEmail.jtp?type=node&node=3243602&i=3" target="_top" rel="nofollow" link="external">[hidden email]</a>&amp;gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; Log:<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; ==&gt;[BeforeActivationFiredEvent:  getActivation()=[Activation rule=Second<br>&gt;&gt;&gt;&gt;&gt; rule, act#=1, salience=25, tuple=[fact<br>
&gt;&gt;&gt;&gt;&gt; 0:1:1428842218:1428842218:1:DEFAULT:Car{color=&#39;red&#39;, size=&#39;small&#39;,<br>&gt;&gt;&gt;&gt;&gt; price=null}]<br>&gt;&gt;&gt;&gt;&gt; ],<br>&gt;&gt;&gt;&gt;&gt; getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]<br>
&gt;&gt;&gt;&gt;&gt; ==&gt;[AfterActivationFiredEvent: getActivation()=[Activation rule=Second<br>&gt;&gt;&gt;&gt;&gt; rule,<br>&gt;&gt;&gt;&gt;&gt; act#=1, salience=25, tuple=[fact<br>&gt;&gt;&gt;&gt;&gt; 0:1:1428842218:1428842218:2:DEFAULT:Car{color=&#39;red&#39;, size=&#39;small&#39;,<br>
&gt;&gt;&gt;&gt;&gt; price=2}]<br>&gt;&gt;&gt;&gt;&gt; ],<br>&gt;&gt;&gt;&gt;&gt; getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]<br>&gt;&gt;&gt;&gt;&gt; ==&gt;[BeforeActivationFiredEvent:  getActivation()=[Activation rule=First<br>
&gt;&gt;&gt;&gt;&gt; rule, act#=0, salience=20, tuple=[fact<br>&gt;&gt;&gt;&gt;&gt; 0:1:1428842218:1428842218:2:DEFAULT:Car{color=&#39;red&#39;, size=&#39;small&#39;,<br>&gt;&gt;&gt;&gt;&gt; price=2}]<br>&gt;&gt;&gt;&gt;&gt; ],<br>
&gt;&gt;&gt;&gt;&gt; getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]<br>&gt;&gt;&gt;&gt;&gt; ==&gt;[AfterActivationFiredEvent: getActivation()=[Activation rule=First<br>&gt;&gt;&gt;&gt;&gt; rule,<br>
&gt;&gt;&gt;&gt;&gt; act#=0, salience=20, tuple=[fact<br>&gt;&gt;&gt;&gt;&gt; 0:1:1428842218:1428842218:3:DEFAULT:Car{color=&#39;red&#39;, size=&#39;small&#39;,<br>&gt;&gt;&gt;&gt;&gt; price=1}]<br>&gt;&gt;&gt;&gt;&gt; ],<br>
&gt;&gt;&gt;&gt;&gt; getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]<br>&gt;&gt;&gt;&gt;&gt; ==&gt;[BeforeActivationFiredEvent:  getActivation()=[Activation rule=Second<br>&gt;&gt;&gt;&gt;&gt; step, act#=2, salience=40, tuple=[fact<br>
&gt;&gt;&gt;&gt;&gt; 0:1:1428842218:1428842218:3:DEFAULT:Car{color=&#39;red&#39;, size=&#39;small&#39;,<br>&gt;&gt;&gt;&gt;&gt; price=1}]<br>&gt;&gt;&gt;&gt;&gt; ],<br>&gt;&gt;&gt;&gt;&gt; getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]<br>
&gt;&gt;&gt;&gt;&gt; ==&gt;[AfterActivationFiredEvent: getActivation()=[Activation rule=Second<br>&gt;&gt;&gt;&gt;&gt; step,<br>&gt;&gt;&gt;&gt;&gt; act#=2, salience=40, tuple=[fact<br>&gt;&gt;&gt;&gt;&gt; 0:1:1428842218:1428842218:3:DEFAULT:Car{color=&#39;red&#39;, size=&#39;small&#39;,<br>
&gt;&gt;&gt;&gt;&gt; price=1}]<br>&gt;&gt;&gt;&gt;&gt; ],<br>&gt;&gt;&gt;&gt;&gt; getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]<br>&gt;&gt;&gt;&gt;&gt; Car{color=&#39;red&#39;, size=&#39;small&#39;, price=1}<br>
&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; java.lang.AssertionError:<br>&gt;&gt;&gt;&gt;&gt; Expected :2<br>&gt;&gt;&gt;&gt;&gt; Actual   :1<br>&gt;&gt;&gt;&gt;&gt;        at org.junit.Assert.fail(Assert.java:91)<br>&gt;&gt;&gt;&gt;&gt;        at org.junit.Assert.failNotEquals(Assert.java:645)<br>
&gt;&gt;&gt;&gt;&gt;        at org.junit.Assert.assertEquals(Assert.java:126)<br>&gt;&gt;&gt;&gt;&gt;        at org.junit.Assert.assertEquals(Assert.java:145)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; CarKnowledgeBaseTest.shouldObtainPriceWhereSalienceIsBigger(CarKnowledgeBaseTest.java:47)<br>
&gt;&gt;&gt;&gt;&gt;        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)<br>
&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)<br>
&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)<br>
&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)<br>&gt;&gt;&gt;&gt;&gt;        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)<br>
&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)<br>
&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)<br>
&gt;&gt;&gt;&gt;&gt;        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)<br>&gt;&gt;&gt;&gt;&gt;        at org.junit.runner.JUnitCore.run(JUnitCore.java:157)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)<br>
&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)<br>
&gt;&gt;&gt;&gt;&gt;        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
&gt;&gt;&gt;&gt;&gt;        at<br>&gt;&gt;&gt;&gt;&gt; com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; --<br>&gt;&gt;&gt;&gt;&gt; View this message in context:<br>
&gt;&gt;&gt;&gt;&gt; <a href="http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3238338.html" target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3238338.html</a><br>&gt;&gt;&gt;&gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt;&gt;&gt; rules-users mailing list<br>&gt;&gt;&gt;&gt;&gt; <a href="/user/SendEmail.jtp?type=node&node=3243602&i=4" target="_top" rel="nofollow" link="external">[hidden email]</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; rules-users mailing list<br>&gt;&gt;&gt; <a href="/user/SendEmail.jtp?type=node&node=3243602&i=5" target="_top" rel="nofollow" link="external">[hidden email]</a><br>&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; --<br>&gt;&gt; View this message in context: <a href="http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3238587.html" target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3238587.html</a><br>
&gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; rules-users mailing list<br>&gt;&gt; <a href="/user/SendEmail.jtp?type=node&node=3243602&i=6" target="_top" rel="nofollow" link="external">[hidden email]</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt;&gt;<br>&gt; <br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>
&gt; <a href="/user/SendEmail.jtp?type=node&node=3243602&i=7" target="_top" rel="nofollow" link="external">[hidden email]</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt; <br>
&gt; <br>&gt; _______________________________________________<br>&gt; If you reply to this email, your message will be added to the discussion below:<br>&gt; <a href="http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3238607.html" target="_top" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3238607.html</a><br>
&gt; <br>&gt; To unsubscribe from Lock-on-active and ruleflow-group, visit <a href="" target="_top" rel="nofollow" link="external">
</div>

        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3243602.html">Re: [rules-users] Lock-on-active and ruleflow-group</a><br/>
Sent from the <a href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html">Drools: User forum mailing list archive</a> at Nabble.com.<br/>