Re: [rules-users] Lock-on-active and ruleflow-group

2011-08-10 Thread bitter
Thank-you
09-08-2011 13:23 użytkownik Wolfgang Laun-2 [via Drools] 
ml-node+3238607-487429483-420...@n3.nabble.com napisał:


 Modules (=agenda-group and ruleflow-group) are fine for large-scale
 rule flow control. First choice for fine-grained rule execution
 control is - Logic.

 Write your constraints so that only one rule fires, e.g., by testing
 price == null.

 Ideally, you should also avoid salience by fully describing the cases
 for prices 1 and 2.

 Using flow control and salience - this isn't rule based programming
 any more, just a very elaborate way of implementing sequential logic.

 -W



 On 9 August 2011 13:08, bitter rgorz...@gmail.com wrote:
 But when I use activation-group only one fact has price. I would like to
 insert two facts (or more) and only one rule invoke per fact.Like in my
test
 class.
 Could you look at use case that I attached in my first post? Thanks.


 Wolfgang Laun-2 wrote:

 You should use activation-group price or similar, not lock-on-active.
 -W


 On 9 August 2011 11:40, Wolfgang Laun lt;wolfgang.l...@gmail.comgt;
 wrote:

 Whenever a ruleflow-group becomes active [...], any rule within that
 group that has lock-on-active set to true will not be activated any
 more. (Emphasis added by me.)

 Do you activate the ruleflow-group before you insert the Car fact?

 -W


 On 9 August 2011 11:05, bitter lt;rgorz...@gmail.comgt; wrote:

 Log:

 ==[BeforeActivationFiredEvent:  getActivation()=[Activation
rule=Second
 rule, act#=1, salience=25, tuple=[fact
 0:1:1428842218:1428842218:1:DEFAULT:Car{color='red', size='small',
 price=null}]
 ],

getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=Second
 rule,
 act#=1, salience=25, tuple=[fact
 0:1:1428842218:1428842218:2:DEFAULT:Car{color='red', size='small',
 price=2}]
 ],

getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[BeforeActivationFiredEvent:  getActivation()=[Activation
rule=First
 rule, act#=0, salience=20, tuple=[fact
 0:1:1428842218:1428842218:2:DEFAULT:Car{color='red', size='small',
 price=2}]
 ],

getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=First
 rule,
 act#=0, salience=20, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],

getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[BeforeActivationFiredEvent:  getActivation()=[Activation
rule=Second
 step, act#=2, salience=40, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],

getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=Second
 step,
 act#=2, salience=40, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],

getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 Car{color='red', size='small', price=1}

 java.lang.AssertionError:
 Expected :2
 Actual   :1
at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.failNotEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:126)
at org.junit.Assert.assertEquals(Assert.java:145)
at

CarKnowledgeBaseTest.shouldObtainPriceWhereSalienceIsBigger(CarKnowledgeBaseTest.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at

org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at

org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at

org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at

org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at

org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at

org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at
 org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at
 org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at
 org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at
 org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at

com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at


Re: [rules-users] Lock-on-active and ruleflow-group

2011-08-09 Thread Wolfgang Laun
Whenever a ruleflow-group becomes active [...], any rule within that group
that has lock-on-active set to true *will not be activated any more*.
(Emphasis added by me.)

Do you activate the ruleflow-group before you insert the Car fact?

-W


On 9 August 2011 11:05, bitter rgorz...@gmail.com wrote:

 Log:

 ==[BeforeActivationFiredEvent:  getActivation()=[Activation rule=Second
 rule, act#=1, salience=25, tuple=[fact
 0:1:1428842218:1428842218:1:DEFAULT:Car{color='red', size='small',
 price=null}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6
 ]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=Second
 rule,
 act#=1, salience=25, tuple=[fact
 0:1:1428842218:1428842218:2:DEFAULT:Car{color='red', size='small',
 price=2}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6
 ]
 ==[BeforeActivationFiredEvent:  getActivation()=[Activation rule=First
 rule, act#=0, salience=20, tuple=[fact
 0:1:1428842218:1428842218:2:DEFAULT:Car{color='red', size='small',
 price=2}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6
 ]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=First rule,
 act#=0, salience=20, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6
 ]
 ==[BeforeActivationFiredEvent:  getActivation()=[Activation rule=Second
 step, act#=2, salience=40, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6
 ]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=Second
 step,
 act#=2, salience=40, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6
 ]
 Car{color='red', size='small', price=1}

 java.lang.AssertionError:
 Expected :2
 Actual   :1
at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.failNotEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:126)
at org.junit.Assert.assertEquals(Assert.java:145)
at

 CarKnowledgeBaseTest.shouldObtainPriceWhereSalienceIsBigger(CarKnowledgeBaseTest.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at

 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at

 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at

 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at

 org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at

 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at

 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at

 com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at

 com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
at
 com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3238338.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Lock-on-active and ruleflow-group

2011-08-09 Thread bitter
Do you activate the ruleflow-group before you insert the Car fact?
No, I don't think so.

This is body of my test class:

public class CarKnowledgeBaseTest {

@Test
public void shouldObtainPriceWhereSalienceIsBigger() throws Exception {

//given
KnowledgeBase kbase = readKnowledgeBaseFromDrl();
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();

//when
Car car = new Car(red, small);
Car car2 = new Car(red, big);

ksession.insert(car);
ksession.insert(car2);
ksession.addEventListener(new DebugAgendaEventListener());
ksession.startProcess(com.car.test);
ksession.fireAllRules();
ksession.dispose();

//then
assertEquals(Integer.valueOf(2), car.getPrice());
assertEquals(Integer.valueOf(1), car2.getPrice());
}

private KnowledgeBase readKnowledgeBaseFromDrl() {
KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
   
knowledgeBuilder.add(ResourceFactory.newClassPathResource(com/car/test/car.drl),
ResourceType.DRL);
   
knowledgeBuilder.add(ResourceFactory.newClassPathResource(com/car/test/flow.rf),
ResourceType.DRF);

if (knowledgeBuilder.hasErrors()) {
throw new
RuntimeException(knowledgeBuilder.getErrors().toString());
}
KnowledgeBase knowledgeBase =
KnowledgeBaseFactory.newKnowledgeBase();
   
knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());
return knowledgeBase;
}
}

--
View this message in context: 
http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3238487.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Lock-on-active and ruleflow-group

2011-08-09 Thread bitter
But when I use activation-group only one fact has price. I would like to
insert two facts (or more) and only one rule invoke per fact.Like in my test
class. 
Could you look at use case that I attached in my first post? Thanks. 


Wolfgang Laun-2 wrote:
 
 You should use activation-group price or similar, not lock-on-active.
 -W
 
 
 On 9 August 2011 11:40, Wolfgang Laun lt;wolfgang.l...@gmail.comgt;
 wrote:

 Whenever a ruleflow-group becomes active [...], any rule within that
 group that has lock-on-active set to true will not be activated any
 more. (Emphasis added by me.)

 Do you activate the ruleflow-group before you insert the Car fact?

 -W


 On 9 August 2011 11:05, bitter lt;rgorz...@gmail.comgt; wrote:

 Log:

 ==[BeforeActivationFiredEvent:  getActivation()=[Activation rule=Second
 rule, act#=1, salience=25, tuple=[fact
 0:1:1428842218:1428842218:1:DEFAULT:Car{color='red', size='small',
 price=null}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=Second
 rule,
 act#=1, salience=25, tuple=[fact
 0:1:1428842218:1428842218:2:DEFAULT:Car{color='red', size='small',
 price=2}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[BeforeActivationFiredEvent:  getActivation()=[Activation rule=First
 rule, act#=0, salience=20, tuple=[fact
 0:1:1428842218:1428842218:2:DEFAULT:Car{color='red', size='small',
 price=2}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=First
 rule,
 act#=0, salience=20, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[BeforeActivationFiredEvent:  getActivation()=[Activation rule=Second
 step, act#=2, salience=40, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=Second
 step,
 act#=2, salience=40, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 Car{color='red', size='small', price=1}

 java.lang.AssertionError:
 Expected :2
 Actual   :1
        at org.junit.Assert.fail(Assert.java:91)
        at org.junit.Assert.failNotEquals(Assert.java:645)
        at org.junit.Assert.assertEquals(Assert.java:126)
        at org.junit.Assert.assertEquals(Assert.java:145)
        at
 CarKnowledgeBaseTest.shouldObtainPriceWhereSalienceIsBigger(CarKnowledgeBaseTest.java:47)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at
 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at
 org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
        at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at
 org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at
 org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at
 org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at
 org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
        at
 com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
        at
 com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
        at
 com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3238338.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 

Re: [rules-users] Lock-on-active and ruleflow-group

2011-08-09 Thread Wolfgang Laun
Modules (=agenda-group and ruleflow-group) are fine for large-scale
rule flow control. First choice for fine-grained rule execution
control is - Logic.

Write your constraints so that only one rule fires, e.g., by testing
price == null.

Ideally, you should also avoid salience by fully describing the cases
for prices 1 and 2.

Using flow control and salience - this isn't rule based programming
any more, just a very elaborate way of implementing sequential logic.

-W



On 9 August 2011 13:08, bitter rgorz...@gmail.com wrote:
 But when I use activation-group only one fact has price. I would like to
 insert two facts (or more) and only one rule invoke per fact.Like in my test
 class.
 Could you look at use case that I attached in my first post? Thanks.


 Wolfgang Laun-2 wrote:

 You should use activation-group price or similar, not lock-on-active.
 -W


 On 9 August 2011 11:40, Wolfgang Laun lt;wolfgang.l...@gmail.comgt;
 wrote:

 Whenever a ruleflow-group becomes active [...], any rule within that
 group that has lock-on-active set to true will not be activated any
 more. (Emphasis added by me.)

 Do you activate the ruleflow-group before you insert the Car fact?

 -W


 On 9 August 2011 11:05, bitter lt;rgorz...@gmail.comgt; wrote:

 Log:

 ==[BeforeActivationFiredEvent:  getActivation()=[Activation rule=Second
 rule, act#=1, salience=25, tuple=[fact
 0:1:1428842218:1428842218:1:DEFAULT:Car{color='red', size='small',
 price=null}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=Second
 rule,
 act#=1, salience=25, tuple=[fact
 0:1:1428842218:1428842218:2:DEFAULT:Car{color='red', size='small',
 price=2}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[BeforeActivationFiredEvent:  getActivation()=[Activation rule=First
 rule, act#=0, salience=20, tuple=[fact
 0:1:1428842218:1428842218:2:DEFAULT:Car{color='red', size='small',
 price=2}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=First
 rule,
 act#=0, salience=20, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[BeforeActivationFiredEvent:  getActivation()=[Activation rule=Second
 step, act#=2, salience=40, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 ==[AfterActivationFiredEvent: getActivation()=[Activation rule=Second
 step,
 act#=2, salience=40, tuple=[fact
 0:1:1428842218:1428842218:3:DEFAULT:Car{color='red', size='small',
 price=1}]
 ],
 getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@72f6f1b6]
 Car{color='red', size='small', price=1}

 java.lang.AssertionError:
 Expected :2
 Actual   :1
        at org.junit.Assert.fail(Assert.java:91)
        at org.junit.Assert.failNotEquals(Assert.java:645)
        at org.junit.Assert.assertEquals(Assert.java:126)
        at org.junit.Assert.assertEquals(Assert.java:145)
        at
 CarKnowledgeBaseTest.shouldObtainPriceWhereSalienceIsBigger(CarKnowledgeBaseTest.java:47)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at
 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at
 org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
        at
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at
 org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at
 org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at
 org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at
 org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
        at
 com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
        at
 com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
        at
 com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
        at 

[rules-users] Lock-on-active and ruleflow-group

2011-08-08 Thread bitter
I have three rules:

rule First rule
salience 20
ruleflow-group rfs_1
lock-on-active true
when
  $c: Car(color == red)  
then
  $c.setPrice(1);
  update($c);
end
   
rule Second rule
salience 25
ruleflow-group rfs_1
lock-on-active true
when
  $c: Car(size == small)
then
  $c.setPrice(2);
  update($c);
end

rule Second step
salience 40
ruleflow-group rfs_2
lock-on-active true
when
 $c: Car()
then
 System.out.println($c);
end

I have class, for example Car, which has three prioperties: color, size,
price.
I insert into session fact-Car(red, small), next start process, and
execute rules.
After that, price value is 1. I thought that Second rule should be fired
only because it has bigger salience but it is exactly the opposite. Could
anyone explain me why first rule was executed/fired and what can I do to
fire only Second rule (without invoking First rule). 
Thanks 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Lock-on-active-and-ruleflow-group-tp3237089p3237089.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users