JBoss Community

Re: Rule Task after Human Task

created by Maciej Swiderski in jBPM - View the full discussion

Vlad, rules must be activated before they can be executed. Activation happens when facts are inserted/updated/retracted into the session. Maybe your case is that nothing happens before the Rule#2 is entered?

 

You could give a try with a onExit script for you human task node that will make any modification to the session, for instance insert a fact.

 

 

     <extensionElements> 
        <tns:onExit-script scriptFormat="http://www.java.com/java">
          <script>kcontext.getKnowledgeRuntime().insert(kcontext.getProcessInstance());</script>
        </tns:onExit-script>
      </extensionElements>

 

That should activate agenda and when process enters rule task it should have rules ready (of course if the rules condition will be satisfied). I am not a big rules expert so ...

 

As for the listener, take a look at: org.drools.event.AgendaEventListener an example usage of it can be found here, to trigger rules execution (of ruleflow-group) as soon as they activated.

 

HTH

Reply to this message by going to Community

Start a new discussion in jBPM at Community