JBoss Community

how to fire rules after human task!!!

created by Xiaojun Hou in jBPM - View the full discussion

Here is my process:

http://community.jboss.org/servlet/JiveServlet/downloadImage/2-608722-16463/450-264/%E6%9C%AA%E5%91%BD%E5%90%8D3.jpg

In the process above,SelectResult is a rule task,i do not know to fire the rules in it after the human tasks ealier.By the way,if the rules can only be fired by "ksession.fireAllRules()" when the current node is a rule task?In the process above i use a script task before the rule task to fire the rule like this:

http://community.jboss.org/servlet/JiveServlet/downloadImage/2-608722-16464/450-137/%E6%9C%AA%E5%91%BD%E5%90%8D2.jpg

but i can not see the result designed in the rule file:

 

package com.sample;

import com.model.Approve;

import org.drools.runtime.process.WorkflowProcessInstance;

rule "Request Passed"

    ruleflow-group "select_result"

    when

        $process: WorkflowProcessInstance()

        Approve(result == "pass") from $process.getVariable("approve1")and

        Approve(result == "pass") from $process.getVariable("approve2")

    then

        System.out.println("Your request has passed!");

       

end

 

rule "Request Failed"

    ruleflow-group "select_result"

    when

        $process: WorkflowProcessInstance()

        Approve(result == "fail") from $process.getVariable("approve1")or

        Approve(result == "fail") from $process.getVariable("approve2")

    then

        System.out.println("Your request has failed!");

       

end

 

The variable request,approve1、approve2 has been defined。Can anybody knows the answer of the problem,hope you can help us who have the same problem!!!

Reply to this message by going to Community

Start a new discussion in jBPM at Community