<br>I'm afraid I can't publish as it is, but I hope this would give you a hint:<br><br>myrules.drl:<br><br>rule "New case" <br> when <br> $case : Case(processed==false) from entry-point "case stream" <br>
then<br> modify ($case){<br> setProcessed(true)<br> }<br> <br> [.... processing code omitted ... ]<br><br> insert(kcontext.getKnowledgeRuntime().startProcess("com.mycompany.Process", parameters));<br>
end<br><br>rule "job complete"<br>ruleflow-group "jobs group"<br> when<br> $processInstance: WorkflowProcessInstance()<br> then<br> Job job = (Job)$processInstance.getVariable("var");<br>
update(job);<br>end<br><br><br><br><br>process.bpmn:<br><br><?xml version="1.0" encoding="UTF-8"?><br><definitions ....><br><process processType="Private" isExecutable="true" id="com.mycompany.Process" name="process" ><br>
[one start node and lots of nodes here, one that ends in the next ]<br><br><businessRuleTask g:ruleFlowGroup="jobs group" id="job complete" name="complete job"/><br><br>[ lots of nodes after, ending in an end node]<br>
<br></process><br></definitions><br><br><br><br><br>As you can see the rule "New case" is not in any group and is responsible ( if it is the case ) of launching the process, and then that process invokes the bussinessrule group "jobs group". As stated, what we see is that the rule "job complete" never gets fired.<br>
<br><br><br clear="all">Alberto R. Galdo<br><a href="/user/SendEmail.jtp?type=node&node=3726616&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a><br><br><div class="gmail_quote">On Tue, Feb 7, 2012 at 21:18, salaboy [via Drools] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=3726616&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
        ""businessRuleTask" who tries to fire a rule in drools ant that rule
<br></div><div class="im">are not in the same group" can you share the process definition and
<br>the rule?
<br><br></div>2012/2/7 Alberto R. Galdo <<a href="http://user/SendEmail.jtp?type=node&node=3723757&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>>:
<div><div class="im"><div class='shrinkable-quote'><br>> Hi,
<br>>
<br>> The rule that inserts the process which has the node "businessRuleTask"
<br>> who tries to fire a rule in drools ant that rule are not in the same group.
<br>> In fact, the rule that should be fired is the only rule in that group and
<br>> should only be fired by the process itself.
<br>>
<br>> What we are trying to do is to update the state of a fact inside drools
<br>> with information gathered in the BPM process. Maybe I am getting this wrong,
<br>> but, Is there another way to accomplish this?
<br>>
<br>> Greets,
<br>>
<br>>
<br>> Alberto R. Galdo
</div></div>> <a href="http://user/SendEmail.jtp?type=node&node=3723757&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><div class="im">>
<div class='shrinkable-quote'><br>>
<br>>
<br>>
<br>> On Tue, Feb 7, 2012 at 19:23, Mauricio Salatino <<a href="http://user/SendEmail.jtp?type=node&node=3723757&i=2" rel="nofollow" link="external" target="_blank">[hidden email]</a>> wrote:
<br>>>
<br>>> Hi are you using the same rule flow-group in the businessRuleTask and
<br>>> in your rule? can you share the rule that you are using?
<br>>> remember that the evaluation will be done by the engine as soon as the
<br>>> information comes in. The rule flow group will only execute something
<br>>> if a rule was activated inside the rule flow group of your
<br>>> businessRuleTask.
<br>>> Cheers
<br>>>
</div></div><div><div class="h5">>> On Tue, Feb 7, 2012 at 2:23 PM, argaldo <<a href="http://user/SendEmail.jtp?type=node&node=3723757&i=3" rel="nofollow" link="external" target="_blank">[hidden email]</a>> wrote:
<div class='shrinkable-quote'><br>>> > Hi,
<br>>> >
<br>>> > We're running an application that uses Drools + JBPM 5 + Drools
<br>>> > integration our set-up can be seen as:
<br>>> >
<br>>> > Some rule fires and creates a JBPM process ( a fact gets inserted into
<br>>> > drools using "kcontext.getKnowledgeRuntime().startProcess()" ), after a
<br>>> > few
<br>>> > nodes processed, the JBPM engine arrives to a node of type
<br>>> > "businessRuleTask" which in turn tells drools to evaluate a group of
<br>>> > rules (
<br>>> > which at the moment consists on only one rule ).
<br>>> >
<br>>> > Well, the problem is that what we see is that everything runs ok before
<br>>> > the businessRuleTask and at the moment when the rule group would be
<br>>> > evaluated we could see that in drools the rule gets created, activated,
<br>>> > but
<br>>> > never fired.
<br>>> >
<br>>> > We did some debug and realized that the reason the rule group never got
<br>>> > fired is because this check in RuleFlowGroupImpl.java ( method
<br>>> > setActive(boolean) ):
<br>>> >
<br>>> > if ( this.list.isEmpty() ) {
<br>>> > if ( this.autoDeactivate ) {
<br>>> > // if the list of activations is empty and
<br>>> > // auto-deactivate is on, deactivate this group
<br>>> > WorkingMemoryAction action = new DeactivateCallback(
<br>>> > this );
<br>>> > this.workingMemory.queueWorkingMemoryAction( action
<br>>> > );
<br>>> > }
<br>>> > }
<br>>> >
<br>>> >
<br>>> > The problem is that at the moment when drools calls setActive() and
<br>>> > performs the check, this.list is in fact empty and autoDeactivate is
<br>>> > true by
<br>>> > default ). Then drools enqueues a deactivation task afterwords, which
<br>>> > deactivates the rule *before* even firing it.
<br>>> >
<br>>> > From now on, things get a little weirder, every subsequent invocation
<br>>> > of
<br>>> > the method setActive ( in response of bussinessRuleTask from our
<br>>> > bussiness
<br>>> > process ) runs ok as that list now is not empty ( has one rule ).
<br>>> >
<br>>> > Seems a race condition to me, but,..., Is there any way to
<br>>> > deactivate
<br>>> > autodeactivation by default? Are we doing something wrong? Bug report?
<br>>> >
<br>>> > Greets,
<br>>> >
<br>>> > --
<br>>> > View this message in context:
<br>>> > <a href="http://drools.46999.n3.nabble.com/Rule-does-not-fire-when-JBPM-asks-to-do-so-in-BPMN-2-0-process-tp3723183p3723183.html" rel="nofollow" link="external" target="_blank">http://drools.46999.n3.nabble.com/Rule-does-not-fire-when-JBPM-asks-to-do-so-in-BPMN-2-0-process-tp3723183p3723183.html</a></div>
>> > Sent from the Drools: User forum mailing list archive at Nabble.com.
<br>>> > _______________________________________________
<br>>> > rules-users mailing list
<br></div></div>>> > <a href="http://user/SendEmail.jtp?type=node&node=3723757&i=4" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><div class="im">>> > <a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>>>
<br>>>
<br>>>
<br>>> --
<br>>> - CTO @ <a href="http://www.plugtree.com" rel="nofollow" link="external" target="_blank">http://www.plugtree.com</a><br>>> - MyJourney @ <a href="http://salaboy.wordpress.com" rel="nofollow" link="external" target="_blank">http://salaboy.wordpress.com</a><br>
>> - Co-Founder @ <a href="http://www.jugargentina.org" rel="nofollow" link="external" target="_blank">http://www.jugargentina.org</a><br>>> - Co-Founder @ <a href="http://www.jbug.com.ar" rel="nofollow" link="external" target="_blank">http://www.jbug.com.ar</a><br>
>>
<br>>> - Salatino "Salaboy" Mauricio -
<br>>>
<br>>> _______________________________________________
<br>>> rules-users mailing list
<br></div>>> <a href="http://user/SendEmail.jtp?type=node&node=3723757&i=5" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><div class="im">>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>>
<br>>
<br>>
<br>> _______________________________________________
<br>> rules-users mailing list
<br></div>> <a href="http://user/SendEmail.jtp?type=node&node=3723757&i=6" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>>
</div><div class="im"><br><br><br>--
<br> - CTO @ <a href="http://www.plugtree.com" rel="nofollow" link="external" target="_blank">http://www.plugtree.com</a><br> - MyJourney @ <a href="http://salaboy.wordpress.com" rel="nofollow" link="external" target="_blank">http://salaboy.wordpress.com</a><br>
- Co-Founder @ <a href="http://www.jugargentina.org" rel="nofollow" link="external" target="_blank">http://www.jugargentina.org</a><br> - Co-Founder @ <a href="http://www.jbug.com.ar" rel="nofollow" link="external" target="_blank">http://www.jbug.com.ar</a><br>
<br> - Salatino "Salaboy" Mauricio -
<br><br>_______________________________________________
<br>rules-users mailing list
<br></div><div class="im"><a href="http://user/SendEmail.jtp?type=node&node=3723757&i=7" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
        
        <br>
        <br>
        <hr color="#cccccc" noshade size="1">
        </div><div style="color:rgb(68,68,68);font:12px tahoma,geneva,helvetica,arial,sans-serif"><div class="im">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                </div><a href="http://drools.46999.n3.nabble.com/Rule-does-not-fire-when-JBPM-asks-to-do-so-in-BPMN-2-0-process-tp3723183p3723757.html" target="_blank" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/Rule-does-not-fire-when-JBPM-asks-to-do-so-in-BPMN-2-0-process-tp3723183p3723757.html</a>
        </div><div class="HOEnZb"><div class="h5">
        <div style="color:rgb(102,102,102);font:11px/1.5em tahoma,geneva,helvetica,arial,sans-serif;margin-top:0.4em">
                
                To unsubscribe from Rule does not fire when JBPM asks to do so in BPMN 2.0 process, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div></div></div></blockquote></div><br>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://drools.46999.n3.nabble.com/Rule-does-not-fire-when-JBPM-asks-to-do-so-in-BPMN-2-0-process-tp3723183p3726616.html">Re: [rules-users] Rule does not fire when JBPM asks to do so in BPMN 2.0 process</a><br/>
Sent from the <a href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html">Drools: User forum mailing list archive</a> at Nabble.com.<br/>