same criteria across multiple rules cancels activation with Property Reactive Facts

classic Classic list List threaded Threaded
4 messages Options
m11
Reply | Threaded
Open this post in threaded view
|

same criteria across multiple rules cancels activation with Property Reactive Facts

m11
I have come across a problem of unexpected cancels on activations when using property reactive facts. The problem occurs  if two or more rules have the same criteria. I have uploaded all the files and a unit test to show this using a very simple bare bones example:

pom.xml
log4j.properties
modify-test.drl
SampleBean.java
RuleRunner.java
RulesLogger.java
ModifyTest.java

Running ModifyTest.java produces the following logs:

0    [main] DEBUG com.demo.rules.session.RulesLogger  - Activation created calculate y
 1    [main] DEBUG com.demo.rules.session.RulesLogger  - Activation created calculate x
 2    [main] DEBUG com.demo.rules.session.RulesLogger  - Before Activation fired calculate x
 4    [main] DEBUG com.demo.rules.session.RulesLogger  - Activation cancelled calculate y
 6    [main] DEBUG com.demo.rules.session.RulesLogger  - After Activation fired [Activation rule=calculate x, act#=1, salience=0, tuple=[fact 0:2:42753698:30752:3:DEFAULT:SampleBean [x=10, y=null, id=1]]
]
 
The activations have been created as expected but an activation on a rule is cancelled unexpectedily as indicated by log statement 4. Why is this?

If all the rules have a different criteria then all works fine.  If i dont use property reactive facts then it works. It looks like this is a bug, can someone confirm this ?

We have some edge case scenarios in our rules where it is possible for some rules to end up with the same criteria. We dont want to force the business analysts to have to merge the rules as we have a very large number of rules, and it will be very hard for them to track the criteria for each rule.

If it is not a bug can someone please provide the rational reason why it is sensible to have the activation cancelled.
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] same criteria across multiple rules cancels activation with Property Reactive Facts

laune
This is certainly a bug, as it is definitely not what one expects from
the description of property reactive.

Existing activations that do not mention the modified property should
not be affected.

I have created a similar test case, and it fails the same way.
It seems that "property reactive" is broken in 5.5.0 and should not be used.

-W


On 14/12/2012, m11 <[hidden email]> wrote:

> I have come across a problem of unexpected cancels on activations when
> using
> property reactive facts. The problem occurs  if two or more rules have the
> same criteria. I have uploaded all the files and a unit test to show this
> using a very simple bare bones example:
>
> pom.xml <http://drools.46999.n3.nabble.com/file/n4021204/pom.xml>
> log4j.properties
> <http://drools.46999.n3.nabble.com/file/n4021204/log4j.properties>
> modify-test.drl
> <http://drools.46999.n3.nabble.com/file/n4021204/modify-test.drl>
> SampleBean.java
> <http://drools.46999.n3.nabble.com/file/n4021204/SampleBean.java>
> RuleRunner.java
> <http://drools.46999.n3.nabble.com/file/n4021204/RuleRunner.java>
> RulesLogger.java
> <http://drools.46999.n3.nabble.com/file/n4021204/RulesLogger.java>
> ModifyTest.java
> <http://drools.46999.n3.nabble.com/file/n4021204/ModifyTest.java>
>
> Running ModifyTest.java produces the following logs:
>
> 0    [main] DEBUG com.demo.rules.session.RulesLogger  - Activation created
> calculate y
>  1    [main] DEBUG com.demo.rules.session.RulesLogger  - Activation created
> calculate x
>  2    [main] DEBUG com.demo.rules.session.RulesLogger  - Before Activation
> fired calculate x
>  4    [main] DEBUG com.demo.rules.session.RulesLogger  - Activation
> cancelled calculate y
>  6    [main] DEBUG com.demo.rules.session.RulesLogger  - After Activation
> fired [Activation rule=calculate x, act#=1, salience=0, tuple=[fact
> 0:2:42753698:30752:3:DEFAULT:SampleBean [x=10, y=null, id=1]]
> ]
>
> The activations have been created as expected but an activation on a rule
> is
> cancelled unexpectedily as indicated by log statement 4. Why is this?
>
> If all the rules have a different criteria then all works fine.  If i dont
> use property reactive facts then it works. It looks like this is a bug, can
> someone confirm this ?
>
> We have some edge case scenarios in our rules where it is possible for some
> rules to end up with the same criteria. We dont want to force the business
> analysts to have to merge the rules as we have a very large number of
> rules,
> and it will be very hard for them to track the criteria for each rule.
>
> If it is not a bug can someone please provide the rational reason why it is
> sensible to have the activation cancelled.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/same-criteria-across-multiple-rules-cancels-activation-with-Property-Reactive-Facts-tp4021204.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
m11
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] same criteria across multiple rules cancels activation with Property Reactive Facts

m11
Hi ,

I re ran the test using drools 5.4.0 too, same problem.  In the majority of our cases Property Reactive Facts work really well. Not using this feature is not really an option that we would like to take as we would have to rewrite the rules. We have thousands of rules.

Can you please let me know the process for getting this bug fixed in drools?  

I would like to propagate this issue to the engineering team and for them to fix the bug in the next release.
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] same criteria across multiple rules cancels activation with Property Reactive Facts

Mark Proctor
On 14 Dec 2012, at 14:10, m11 <[hidden email]> wrote:

> Hi ,
>
> I re ran the test using drools 5.4.0 too, same problem.  In the majority of
> our cases Property Reactive Facts work really well. Not using this feature
> is not really an option that we would like to take as we would have to
> rewrite the rules. We have thousands of rules.
>
> Can you please let me know the process for getting this bug fixed in drools?  
Contact Red Hat for support subscription information, which will give you a direct line to RHT product management, for bug escalation. [hidden email]
http://blog.athico.com/2011/04/drools-jbpm-community-versus-product.html

I also wrote a page on how to submit unit tests and bug fixes:
http://docs.jboss.org/drools/release/5.4.0.Final/droolsjbpm-introduction-docs/html/gettingstarted.html

Mark

>
> I would like to propagate this issue to the engineering team and for them to
> fix the bug in the next release.
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/same-criteria-across-multiple-rules-cancels-activation-with-Property-Reactive-Facts-tp4021204p4021208.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users