[rules-users] Rule does not fire when JBPM asks to do so in BPMN 2.0 process

argaldo argaldo at gmail.com
Tue Feb 7 12:23:53 EST 2012


Hi,

  We're running an application that uses Drools + JBPM 5 + Drools
integration our set-up can be seen as:

  Some rule fires and creates a JBPM process ( a fact gets inserted into
drools using "kcontext.getKnowledgeRuntime().startProcess()" ), after a few
nodes processed, the JBPM engine arrives to a node of type
"businessRuleTask" which in turn tells drools to evaluate a group of rules (
which at the moment consists on only one rule ).

  Well, the problem is that what we see is that everything runs ok before
the businessRuleTask and at the moment when the rule group would be
evaluated we could see that in drools the rule gets created, activated, but
never fired.

  We did some debug and realized that the reason the rule group never got
fired is because this check in RuleFlowGroupImpl.java ( method
setActive(boolean) ):

            if ( this.list.isEmpty() ) {
                if ( this.autoDeactivate ) {
                    // if the list of activations is empty and
                    // auto-deactivate is on, deactivate this group
                    WorkingMemoryAction action = new DeactivateCallback(
this );
                    this.workingMemory.queueWorkingMemoryAction( action );
                }
            }


   The problem is that at the moment when drools calls setActive() and
performs the check, this.list is in fact empty and autoDeactivate is true by
default ). Then drools enqueues a deactivation task afterwords, which
deactivates the rule *before* even firing it. 

    From now on, things get a little weirder, every subsequent invocation of
the method setActive ( in response of bussinessRuleTask from our bussiness
process ) runs ok as that list now is not empty ( has one rule ).

    Seems a race condition to me, but,...,  Is there any way to deactivate
autodeactivation by default? Are we doing something wrong? Bug report?

Greets,

--
View this message in context: http://drools.46999.n3.nabble.com/Rule-does-not-fire-when-JBPM-asks-to-do-so-in-BPMN-2-0-process-tp3723183p3723183.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list