[jboss-user] [jBPM] - Re: Rule Task after Human Task

Maciej Swiderski do-not-reply at jboss.com
Fri Jan 20 09:20:02 EST 2012


Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Rule Task after Human Task"

To view the discussion, visit: https://community.jboss.org/message/647845#647845

--------------------------------------------------------------
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 (https://github.com/droolsjbpm/jbpm/blob/master/jbpm-gwt/jbpm-gwt-core/src/main/java/org/jbpm/integration/console/StatefulKnowledgeSessionUtil.java), to trigger rules execution (of ruleflow-group) as soon as they activated.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/647845#647845]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120120/660ad910/attachment-0001.html 


More information about the jboss-user mailing list