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

Mauricio Salatino salaboy at gmail.com
Tue Feb 7 15:16:34 EST 2012


""businessRuleTask" who tries to fire a rule in drools ant that rule
are not in the same group" can you share the process definition and
the rule?

2012/2/7 Alberto R. Galdo <argaldo at gmail.com>:
> Hi,
>
>    The rule that inserts the process which has the node "businessRuleTask"
> who tries to fire a rule in drools ant that rule are not in the same group.
> In fact, the rule that should be fired is the only rule in that group and
> should only be fired by the process itself.
>
>    What we are trying to do is to update the state of a fact inside drools
> with information gathered in the BPM process. Maybe I am getting this wrong,
> but, Is there another way to accomplish this?
>
> Greets,
>
>
> Alberto R. Galdo
> argaldo at gmail.com
>
>
>
>
> On Tue, Feb 7, 2012 at 19:23, Mauricio Salatino <salaboy at gmail.com> wrote:
>>
>> Hi are you using the same rule flow-group in the businessRuleTask and
>> in your rule? can you share the rule that you are using?
>> remember that the evaluation will be done by the engine as soon as the
>> information comes in. The rule flow group will only execute something
>> if a rule was activated inside the rule flow group of your
>> businessRuleTask.
>> Cheers
>>
>> On Tue, Feb 7, 2012 at 2:23 PM, argaldo <argaldo at gmail.com> wrote:
>> > 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.
>> > _______________________________________________
>> > rules-users mailing list
>> > rules-users at lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>>
>> --
>>  - CTO @ http://www.plugtree.com
>>  - MyJourney @ http://salaboy.wordpress.com
>>  - Co-Founder @ http://www.jugargentina.org
>>  - Co-Founder @ http://www.jbug.com.ar
>>
>>  - Salatino "Salaboy" Mauricio -
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -




More information about the rules-users mailing list