[rules-users] Re: Ruleflow-group attribute causing rule to not fire

Kris Verlaenen kris.verlaenen at cs.kuleuven.be
Wed May 21 08:03:35 EDT 2008


This is expected behaviour, let me try to explain.

By adding the ruleflow-group attribute to your rules, you are stating that these rule should not be executed as normal, but that the order in which these rules should be executed is specified by a ruleflow.  Activations will be created for rules that are part of a ruleflow-group, but they will only be executed if the ruleflow-group is activated. To make sure that rules with a ruleflow-group are executed, you must:
 1. Create a ruleflow that specifies when the rules should be activated (using ruleset nodes)
 AND 
 2. Start the ruleflow whenever appropriate.  My guess is that you are not starting the ruleflow, so the corresponding ruleflow-groups are never activated.  You can either start a ruleflow manually in your code (workingMemory.startProcess("id_of_your_ruleflow"), for example right before calling workingMemory.fireAllRules()), or using a rule (probably with a high salience) with as consequence drools.getWorkingMemory().startProcess("id_of_your_ruleflow").

It is also normal that all other rules that are not tagged with a ruleflow-group attribute just execute as before, even in the presence of ruleflows, both can be used side by side.

Kris

  ----- Original Message ----- 
  From: Roger Tanuatmadja 
  To: rules-users at lists.jboss.org 
  Sent: Monday, May 19, 2008 9:25 PM
  Subject: [rules-users] Re: Ruleflow-group attribute causing rule to not fire




    From: "Roger Tanuatmadja" <rogerst at gmail.com>
    To: rules-users at lists.jboss.org
    Date: Mon, 19 May 2008 11:55:19 -0700
    Subject: Ruleflow-group attribute causing rule to not fire

    Hi, 

    I am new to both rules engine and Drools. I am currently evaluating Drools 4.0.7 for use in our new project. 
    Basically I have been writing a bunch of individual rules and things have been fine, the rules that I expected to fire were fired, etc, etc. I then proceeded to investigate rule flows. I started innocently enough i.e. adding the ruleflow-group attribute to some of my rules. I also defined a ruleflow mapping (.rfm). 

    I then reran my unit-tests (WITHOUT reading the rules in as rule flows) and some of my rules were no longer firing!!. I added an Agenda Listener to my code and
    1. without the ruleflow-group attribute, activations were created, and fired.
    2. with the ruleflow-group attribute, activations were created but not fired.

    Using the debugger yielded the same logical outcomes i.e. without the ruleflow-group attribute, my breakpoints were hit, but with the attribute specified, none of my breakpoints were hit. 

    My question is: Is this behavior expected? And why? Especially since some other rules (with the attribute specified) continued to work. I've read the documentations as much as possible, but I am really new to this field so I might not even know what questions to ask either.

    Any help would be greatly appreciated.

    Thanks,

    Roger








------------------------------------------------------------------------------


  _______________________________________________
  rules-users mailing list
  rules-users at lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080521/7a9baeda/attachment.html 


More information about the rules-users mailing list