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